beam-cli
Version:
A beautifully simple CLI for running Lighthouse audits on a statically generated (SSG) website
31 lines (30 loc) • 835 B
JavaScript
import test from 'ava';
import { validateFlags } from '../../flags/validate.js';
test('Validate All Flags', async (t) => {
t.is(await validateFlags([''], {
config: 'test',
dist: 'test',
urls: 'test,test',
port: 1234,
setup: true,
gui: false,
}), true);
});
test('Validate Config Flag', async (t) => {
t.is(await validateFlags([''], {
config: 'test',
}), true);
await t.throwsAsync(async () => validateFlags([''], {
// @ts-expect-error testing error handling
config: 1234,
}));
});
test('Validate Port Flag', async (t) => {
t.is(await validateFlags([''], {
port: 1234,
}), true);
await t.throwsAsync(async () => validateFlags([''], {
// @ts-expect-error testing error handling
port: '1234',
}));
});