diff options
Diffstat (limited to 'packages/create-astro/test/context.test.js')
-rw-r--r-- | packages/create-astro/test/context.test.js | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/packages/create-astro/test/context.test.js b/packages/create-astro/test/context.test.js index 113417417..654733e6c 100644 --- a/packages/create-astro/test/context.test.js +++ b/packages/create-astro/test/context.test.js @@ -1,62 +1,73 @@ -import { expect } from 'chai'; - +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; import os from 'node:os'; import { getContext } from '../dist/index.js'; - describe('context', () => { it('no arguments', async () => { const ctx = await getContext([]); - expect(ctx.projectName).to.be.undefined; - expect(ctx.template).to.be.undefined; - expect(ctx.skipHouston).to.eq(os.platform() === 'win32'); - expect(ctx.dryRun).to.be.undefined; + assert.ok(!ctx.projectName); + assert.ok(!ctx.template); + assert.deepStrictEqual(ctx.skipHouston, os.platform() === 'win32'); + assert.ok(!ctx.dryRun); }); + it('project name', async () => { const ctx = await getContext(['foobar']); - expect(ctx.projectName).to.eq('foobar'); + assert.deepStrictEqual(ctx.projectName, 'foobar'); }); + it('template', async () => { const ctx = await getContext(['--template', 'minimal']); - expect(ctx.template).to.eq('minimal'); + assert.deepStrictEqual(ctx.template, 'minimal'); }); + it('skip houston (explicit)', async () => { const ctx = await getContext(['--skip-houston']); - expect(ctx.skipHouston).to.eq(true); + assert.deepStrictEqual(ctx.skipHouston, true); }); + it('skip houston (yes)', async () => { const ctx = await getContext(['-y']); - expect(ctx.skipHouston).to.eq(true); + assert.deepStrictEqual(ctx.skipHouston, true); }); + it('skip houston (no)', async () => { const ctx = await getContext(['-n']); - expect(ctx.skipHouston).to.eq(true); + assert.deepStrictEqual(ctx.skipHouston, true); }); + it('skip houston (install)', async () => { const ctx = await getContext(['--install']); - expect(ctx.skipHouston).to.eq(true); + assert.deepStrictEqual(ctx.skipHouston, true); }); + it('dry run', async () => { const ctx = await getContext(['--dry-run']); - expect(ctx.dryRun).to.eq(true); + assert.deepStrictEqual(ctx.dryRun, true); }); + it('install', async () => { const ctx = await getContext(['--install']); - expect(ctx.install).to.eq(true); + assert.deepStrictEqual(ctx.install, true); }); + it('no install', async () => { const ctx = await getContext(['--no-install']); - expect(ctx.install).to.eq(false); + assert.deepStrictEqual(ctx.install, false); }); + it('git', async () => { const ctx = await getContext(['--git']); - expect(ctx.git).to.eq(true); + assert.deepStrictEqual(ctx.git, true); }); + it('no git', async () => { const ctx = await getContext(['--no-git']); - expect(ctx.git).to.eq(false); + assert.deepStrictEqual(ctx.git, false); }); + it('typescript', async () => { const ctx = await getContext(['--typescript', 'strict']); - expect(ctx.typescript).to.eq('strict'); + assert.deepStrictEqual(ctx.typescript, 'strict'); }); }); |