aboutsummaryrefslogtreecommitdiffstats
path: root/tests/runner/command.js
blob: 655024fb4cf4e0a2ef4bd3b921ca9d07204d83f3 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import yargs from "yargs/yargs";
import { browsers } from "./browsers.js";
import { suites } from "./suites.js";
import { run } from "./run.js";
import { jquery } from "./jquery.js";

const argv = yargs( process.argv.slice( 2 ) )
	.version( false )
	.strict()
	.command( {
		command: "[options]",
		describe: "Run jQuery tests in a browser"
	} )
	.option( "suite", {
		alias: "s",
		type: "array",
		choices: suites,
		description:
			"Run tests for a specific test suite.\n" +
			"Pass multiple test suites by repeating the option.\n" +
			"Defaults to all suites."
	} )
	.option( "jquery", {
		alias: "j",
		type: "array",
		choices: jquery,
		description:
			"Run tests against a specific jQuery version.\n" +
			"Pass multiple versions by repeating the option.",
		default: [ "3.7.1" ]
	} )
	.option( "migrate", {
		type: "boolean",
		description:
			"Run tests with jQuery Migrate enabled.",
		default: false
	} )
	.option( "browser", {
		alias: "b",
		type: "array",
		choices: browsers,
		description:
			"Run tests in a specific browser.\n" +
			"Pass multiple browsers by repeating the option.",
		default: [ "chrome" ]
	} )
	.option( "headless", {
		alias: "h",
		type: "boolean",
		description:
			"Run tests in headless mode. Cannot be used with --debug.",
		conflicts: [ "debug" ]
	} )
	.option( "debug", {
		alias: "d",
		type: "boolean",
		description:
			"Leave the browser open for debugging. Cannot be used with --headless.",
		conflicts: [ "headless" ]
	} )
	.option( "retries", {
		alias: "r",
		type: "number",
		description: "Number of times to retry failed tests."
	} )
	.option( "concurrency", {
		alias: "c",
		type: "number",
		description: "Run tests in parallel in multiple browsers. Defaults to 8."
	} )
	.option( "verbose", {
		alias: "v",
		type: "boolean",
		description: "Log additional information."
	} )
	.help().argv;

run( argv );