Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Oct 24, 2023
1 parent b236d88 commit 63f7242
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
12 changes: 6 additions & 6 deletions packages/create-astro/test/typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('typescript', () => {

describe('typescript: setup tsconfig', () => {
beforeEach(() => resetFixtures());

it('none', async () => {
const root = new URL('./fixtures/empty/', import.meta.url);
const tsconfig = new URL('./tsconfig.json', root);
Expand Down Expand Up @@ -126,11 +126,11 @@ describe('typescript: setup package', () => {
);
await setupTypeScript('strictest', { cwd: fileURLToPath(root), install: false });
const { scripts } = JSON.parse(fs.readFileSync(packageJson, { encoding: 'utf-8' }));

expect(Object.keys(scripts)).to.deep.eq(['dev', 'build', 'preview'], 'does not override existing scripts');
expect(scripts.build).to.eq(
'astro check && astro build',
'prepends astro check command'

expect(Object.keys(scripts)).to.deep.eq(
['dev', 'build', 'preview'],
'does not override existing scripts'
);
expect(scripts.build).to.eq('astro check && astro build', 'prepends astro check command');
});
});
21 changes: 10 additions & 11 deletions packages/create-astro/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ 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'
}
}
)
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',
},
});

return Promise.all([
fs.promises.writeFile(packagePath, JSON.stringify(overriddenPackageJson, null, 2), {
Expand Down

0 comments on commit 63f7242

Please sign in to comment.