mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
062623438b
* chore: use biome to sort imports * do the sorting * Update package.json Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
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;
|
|
};
|
|
|
|
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');
|
|
});
|
|
});
|