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/verify.test.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.1 KiB
JavaScript
Raw Normal View History

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { verify } from '../dist/index.js';
import { setup } from './utils.js';
describe('verify', async () => {
const fixture = setup();
const exit = (code) => {
throw code;
2023-08-16 14:39:52 -05:00
};
it('basics', async () => {
const context = { template: 'basics', exit };
await verify(context);
assert.equal(fixture.messages().length, 0, 'Did not expect `verify` to log any messages');
});
it('missing', async () => {
const context = { template: 'missing', exit };
let err = null;
try {
await verify(context);
} catch (e) {
err = e;
}
assert.equal(err, 1);
assert.ok(!fixture.hasMessage('Template missing does not exist!'));
});
it('starlight', async () => {
const context = { template: 'starlight', exit };
await verify(context);
assert.equal(fixture.messages().length, 0, 'Did not expect `verify` to log any messages');
});
it('starlight/tailwind', async () => {
const context = { template: 'starlight/tailwind', exit };
await verify(context);
assert.equal(fixture.messages().length, 0, 'Did not expect `verify` to log any messages');
});
});