2021-04-22 12:25:57 +00:00
|
|
|
import { suite } from 'uvu';
|
|
|
|
import * as assert from 'uvu/assert';
|
|
|
|
import { runDevServer } from './helpers.js';
|
|
|
|
|
|
|
|
const ConfigPath = suite('Config path');
|
|
|
|
|
|
|
|
const root = new URL('./fixtures/config-path/', import.meta.url);
|
|
|
|
ConfigPath('can be passed via --config', async (context) => {
|
|
|
|
const configPath = new URL('./config/my-config.mjs', root).pathname;
|
|
|
|
const args = ['--config', configPath];
|
|
|
|
const process = runDevServer(root, args);
|
|
|
|
|
|
|
|
process.stdout.setEncoding('utf8');
|
|
|
|
for await (const chunk of process.stdout) {
|
2021-05-03 18:26:10 +00:00
|
|
|
if (/Server started/.test(chunk)) {
|
2021-04-22 12:25:57 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
process.kill();
|
|
|
|
assert.ok(true, 'Server started');
|
|
|
|
});
|
|
|
|
|
|
|
|
ConfigPath.run();
|