diff options
Diffstat (limited to 'packages/create-astro/test/utils.js')
-rw-r--r-- | packages/create-astro/test/utils.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/packages/create-astro/test/utils.js b/packages/create-astro/test/utils.js index dfae93c33..20063ec53 100644 --- a/packages/create-astro/test/utils.js +++ b/packages/create-astro/test/utils.js @@ -1,4 +1,3 @@ -import fs from 'node:fs'; import { before, beforeEach } from 'node:test'; import { stripVTControlCharacters } from 'node:util'; import { setStdout } from '../dist/index.js'; @@ -31,33 +30,3 @@ export function setup() { }, }; } - -const resetEmptyFixture = () => - fs.promises.rm(new URL('./fixtures/empty/tsconfig.json', import.meta.url)); - -const resetNotEmptyFixture = async () => { - const packagePath = new URL('./fixtures/not-empty/package.json', import.meta.url); - const tsconfigPath = new URL('./fixtures/not-empty/tsconfig.json', import.meta.url); - - const packageJsonData = JSON.parse( - await fs.promises.readFile(packagePath, { encoding: 'utf-8' }), - ); - const overriddenPackageJson = Object.assign(packageJsonData, { - scripts: { - dev: 'astro dev', - build: 'astro build', - preview: 'astro preview', - }, - dependencies: undefined, - }); - - return Promise.all([ - fs.promises.writeFile(packagePath, JSON.stringify(overriddenPackageJson, null, 2), { - encoding: 'utf-8', - }), - fs.promises.writeFile(tsconfigPath, '{}', { encoding: 'utf-8' }), - ]); -}; - -export const resetFixtures = () => - Promise.allSettled([resetEmptyFixture(), resetNotEmptyFixture()]); |