summaryrefslogtreecommitdiff
path: root/test/config-path.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-04-22 08:25:57 -0400
committerGravatar GitHub <noreply@github.com> 2021-04-22 08:25:57 -0400
commitda033e27eada3bbcad5544be282e9edcf4799003 (patch)
tree8fa1203d4e318f006d254abff79caa2508a86fd2 /test/config-path.test.js
parenta7185735da7413e132f313ff5086db74304d7654 (diff)
downloadastro-da033e27eada3bbcad5544be282e9edcf4799003.tar.gz
astro-da033e27eada3bbcad5544be282e9edcf4799003.tar.zst
astro-da033e27eada3bbcad5544be282e9edcf4799003.zip
CLI docs (#121)
* Start of cli docs * Document the CLI Also adds support for the `--config` option and `--port` option for the dev server. * Add tests for --config and --port flags * Add port to validateConfig
Diffstat (limited to 'test/config-path.test.js')
-rw-r--r--test/config-path.test.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/config-path.test.js b/test/config-path.test.js
new file mode 100644
index 000000000..a13e099b3
--- /dev/null
+++ b/test/config-path.test.js
@@ -0,0 +1,24 @@
+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) {
+ if(/Server running at/.test(chunk)) {
+ break;
+ }
+ }
+
+ process.kill();
+ assert.ok(true, 'Server started');
+});
+
+ConfigPath.run();