-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
170 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"extends": "artdeco" | ||
"extends": "artdeco", | ||
"rules": { | ||
"quote-props": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import argufy from 'argufy' | ||
|
||
export const argsConfig = { | ||
'tests': { | ||
description: 'The location of the test suite directory or file.', | ||
command: true, | ||
multiple: true, | ||
}, | ||
'alamode': { | ||
description: 'Enable import/export transpilation with ÀLaMode.', | ||
boolean: true, | ||
short: 'a', | ||
}, | ||
'babel': { | ||
description: 'Require `@babel/register` (needs to be installed).', | ||
boolean: true, | ||
short: 'b', | ||
}, | ||
'watch': { | ||
description: 'Start the runner in _watch_ mode (rerun on changes).', | ||
boolean: true, | ||
short: 'w', | ||
}, | ||
'timeout': { | ||
description: 'Timeout for tests in ms.', | ||
number: true, | ||
default: '2000', | ||
short: 't', | ||
}, | ||
'snapshot': { | ||
description: 'The location of the snapshot dir.', | ||
default: 'test/snapshot', | ||
short: 's', | ||
}, | ||
'snapshotRoot': { | ||
description: 'The list of folders that will be roots in the snapshot dir.', | ||
default: 'test/spec,test/mask', | ||
short: 'r', | ||
}, | ||
'interactive': { | ||
description: 'Run in interactive mode, allowing to update snapshots\nand mask results when they don\'t match currently expected.', | ||
boolean: true, | ||
short: 'i', | ||
}, | ||
'version': { | ||
description: 'Show the current version.', | ||
boolean: true, | ||
short: 'v', | ||
}, | ||
'help': { | ||
description: 'Display help information.', | ||
boolean: true, | ||
short: 'h', | ||
}, | ||
} | ||
const args = argufy(argsConfig) | ||
|
||
/** | ||
* The location of the test suite directory or file. | ||
*/ | ||
export const _tests = /** @type {string} */ (args['tests']) | ||
|
||
/** | ||
* Enable import/export transpilation with ÀLaMode. | ||
*/ | ||
export const _alamode = /** @type {boolean} */ (args['alamode']) | ||
|
||
/** | ||
* Require `@babel/register` (needs to be installed). | ||
*/ | ||
export const _babel = /** @type {boolean} */ (args['babel']) | ||
|
||
/** | ||
* Start the runner in _watch_ mode (rerun on changes). | ||
*/ | ||
export const _watch = /** @type {boolean} */ (args['watch']) | ||
|
||
/** | ||
* Timeout for tests in ms. Default `2000`. | ||
*/ | ||
export const _timeout = /** @type {number} */ (args['timeout']) || 2000 | ||
|
||
/** | ||
* The location of the snapshot dir. Default `test/snapshot`. | ||
*/ | ||
export const _snapshot = /** @type {string} */ (args['snapshot']) || 'test/snapshot' | ||
|
||
/** | ||
* The list of folders that will be roots in the snapshot dir. Default `test/spec,test/mask`. | ||
*/ | ||
export const _snapshotRoot = /** @type {string} */ (args['snapshotRoot']) || 'test/spec,test/mask' | ||
|
||
/** | ||
* Run in interactive mode, allowing to update snapshots | ||
and mask results when they don't match currently expected. | ||
*/ | ||
export const _interactive = /** @type {boolean} */ (args['interactive']) | ||
|
||
/** | ||
* Show the current version. | ||
*/ | ||
export const _version = /** @type {boolean} */ (args['version']) | ||
|
||
/** | ||
* Display help information. | ||
*/ | ||
export const _help = /** @type {boolean} */ (args['help']) | ||
|
||
/** | ||
* The additional arguments passed to the program. | ||
*/ | ||
export const _argv = /** @type {!Array<string>} */ (args._argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
import usually from 'usually' | ||
|
||
export default () => { | ||
const usage = usually({ | ||
usage: { | ||
pathToSpec: 'The path to a test suite file.', | ||
'-w, --watch': 'Monitor files for changes and re-run tests.', | ||
'-a, --alamode': 'Require ÀLaMode to enable import/export & JSX.', | ||
'-b, --babel': 'Require babel/register.', | ||
'-s, --snapshot': 'The path to the snapshot dir.\nDefault test/snapshot.', | ||
'-i, --interactive': 'Enable prompts to update snapshots.', | ||
'-r, --snapshotRoot': 'Comma-separated snapshot roots.\nDefault test/spec,test/mask.', | ||
'-v, --version': 'Print version number and exit.', | ||
'-h, --help': 'Display this usage information.', | ||
}, | ||
description: 'A testing framework with support for test contexts.', | ||
line: 'zoroaster pathToSpec [pathToSpecN] [-w] [-ab] [-sr] [-vh]', | ||
export default (usage) => { | ||
const res = usually({ | ||
usage, | ||
description: `A testing framework with support for test contexts and masks. | ||
Automatically transpiles import/export and JSX with ÀLaMode. | ||
https://artdecocode.com/zoroaster/`, | ||
line: 'zoroaster path [pathN] [-w] [-ab] [-sr] [-vh]', | ||
example: 'zoroaster test/spec test/mask -a', | ||
}) | ||
return usage | ||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<arguments> | ||
<arg command multiple name="tests"> | ||
The location of the test suite directory or file. | ||
</arg> | ||
<arg boolean name="alamode" short="a"> | ||
Enable import/export transpilation with ÀLaMode. | ||
</arg> | ||
<arg boolean name="babel" short="b"> | ||
Require `@babel/register` (needs to be installed). | ||
</arg> | ||
<arg boolean name="watch" short="w"> | ||
Start the runner in _watch_ mode (rerun on changes). | ||
</arg> | ||
<arg number name="timeout" short="t" default="2000"> | ||
Timeout for tests in ms. | ||
</arg> | ||
<arg name="snapshot" short="s" default="test/snapshot"> | ||
The location of the snapshot dir. | ||
</arg> | ||
<arg name="snapshotRoot" short="r" | ||
default="test/spec,test/mask"> | ||
The list of folders that will be roots in the snapshot dir. | ||
</arg> | ||
<arg boolean name="interactive" short="i" > | ||
Run in interactive mode, allowing to update snapshots | ||
and mask results when they don't match currently expected. | ||
</arg> | ||
<arg boolean name="version" short="v"> | ||
Show the current version. | ||
</arg> | ||
<arg boolean name="help" short="h"> | ||
Display help information. | ||
</arg> | ||
</arguments> |