This repository was archived by the owner on Sep 20, 2022. It is now read-only.
Repository navigation
8000
div>
Expand file tree
/
Copy pathcli.js
More file actions
35 lines (30 loc) · 1.32 KB
/
Copy pathcli.js
File metadata and controls
35 lines (30 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
const path = require('path');
const opener = require('opener');
const chalk = require('chalk');
const program = require('commander');
const pkg = require('../package.json');
const server = require('./server');
const collect = (newValue, array) => (array || []).concat(newValue);
exports.run = () => {
program
.version(pkg.version)
.allowUnknownOption(true)
.option('-b, --browser <browser>', 'run test only in the specified browser', collect)
.option('-p, --port <port>', 'Port to launch server on', 8000)
.option('-h, --hostname <hostname>', 'Hostname to launch server on', 'localhost')
.option('-c, --config <file>', 'Gemini config file', path.resolve, '')
.option('-g, --grep <pattern>', 'run only suites matching the pattern', RegExp)
.option('-s, --set <set>', 'set to run', collect)
.option('-a, --auto-run', 'auto run immediately')
.parse(process.argv);
program.on('--help', () => {
console.log('Also you can override gemini config options.');
console.log('See all possible options in gemini documentation.');
});
program.testFiles = [].concat(program.args);
server.start(program).then((result) => {
console.log(`GUI is running at ${chalk.cyan(result.url)}`);
opener(result.url);
}).done();
};