0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/packages/create-astro/test/template.test.js
2023-02-06 16:21:48 +00:00

36 lines
1.1 KiB
JavaScript

import { expect } from 'chai';
import { template } from '../dist/index.js';
import { setup } from './utils.js';
describe('template', () => {
const fixture = setup();
it('none', async () => {
const context = { template: '', cwd: '', dryRun: true, prompt: () => ({ template: 'blog' }) };
await template(context);
expect(fixture.hasMessage('Skipping template copying')).to.be.true;
expect(context.template).to.eq('blog');
});
it('minimal (--dry-run)', async () => {
const context = { template: 'minimal', cwd: '', dryRun: true, prompt: () => {} };
await template(context);
expect(fixture.hasMessage('Using minimal as project template')).to.be.true;
});
it('basics (--dry-run)', async () => {
const context = { template: 'basics', cwd: '', dryRun: true, prompt: () => {} };
await template(context);
expect(fixture.hasMessage('Using basics as project template')).to.be.true;
});
it('blog (--dry-run)', async () => {
const context = { template: 'blog', cwd: '', dryRun: true, prompt: () => {} };
await template(context);
expect(fixture.hasMessage('Using blog as project template')).to.be.true;
});
});