14 Commits

Author SHA1 Message Date
Nate Fischer
ffdd60b3b6 refactor: use expectations for t.throws
No change to logic. This is a small refactor to use stricter
"expectation" arguments for calls to t.throws().
2025-04-07 23:29:18 -07:00
Nate Fischer
1a31356343 refactor: use require instead of import
No change to logic. This swaps over tests to use require() since
everything is currently designed for the commonjs module system.
2025-04-07 22:44:24 -07:00
Nate Fischer
03d2f20e27 refactor: unescape quotes
This swaps out quote characters to limit how often we need to escape
strings. This is just to improve code readability.

Almost all of the changes could be done without changes to .eslintrc,
however this amends the lint rule to also permit backtick strings which
can be useful to eliminate a few extra instances of quote escaping.

Fixes issue #788
Test: npm run lint
2025-02-19 22:35:39 -08:00
Nate Fischer
a2343d0eab
refactor: harden plugins against unknown options (#804)
This reworks the plugin API such that:

 - Unable to register a command with unknown wrap-options
 - `TypeError` raised for wrap-option type mistakes
 - Remove the `overWrite` option (it's unused, probably safest to not
   expose for now)
 - `cmdOptions` defaults to `null` instead of `false` for type
   consistency (no change to default behavior)
 - Move `pipeMethods` logic into `_register`, since it makes more sense
   there

This is not expected to have any effect on existing plugins.
2017-11-16 12:44:51 -08:00
Nate Fischer
2ee83ebf74 refactor(test): update AVA and refactor tests (#760)
This updates tests for `AVA` 19.0.0+.

`AVA` 0.18.0 has a breaking change which changes the current working directory
for tests. As a result, we need to change 'resources' -> 'test/resources' (and
 similar path changes).

`AVA` 0.19.0 has a breaking change that all tests must run at least one assert.
This breaking change was already resolved by #746, so no change was necessary in
this PR.

This updates to `AVA` 0.21.0, since there are no other breaking changes.
2017-08-11 11:03:13 -07:00
Nate Fischer
ac0ff873f1 refactor: add config.reset() and .resetForTesting() (#641)
Add .reset() and .resetForTesting() to shell.config and use .resetForTesting()
as a standard set-up for unit tests.
2017-01-07 22:40:38 -08:00
Brandon Freitag
7fa4b995bf Finalize moving to ava (#630)
* Move ava-test/ directory to test/

* Remove unnecessary run-tests.js script

* Run only ava during npm test script
2016-12-20 11:27:02 -08:00
Nate Fischer
00dd0f6641 test: refactor plugin tests to AVA (#579) 2016-11-27 11:48:18 -08:00
Nate Fischer
4975b54a4f feat: plugin.error() takes an options parameter (#535)
This implements the following options: `continue`, `code`, `prefix`, & `silent`.

Fixes #522, #523
2016-10-23 23:17:42 -07:00
Nate Fischer
a0c9032072 refactor: readFromPipe() requires no arguments (#506) 2016-08-13 15:50:31 -07:00
Nate Fischer
902f92ab5b feat: add overWrite option for commands (#503)
* feat: add overWrite option for commands

* fix: throws an error if a command is overwritten
2016-08-08 11:44:16 -07:00
Nate Fischer
2395214fee chore: switch to eslint (#504)
* chore: switch to eslint

* fix: works on older versions of NodeJS now

* chore: fix curly braces

* chore: fix indents and remove jshint references
2016-08-07 12:16:29 -07:00
Nate Fischer
d4111763a9 refactor: glob by default for commands (#492) 2016-07-27 16:43:01 -07:00
Nate Fischer
8f7a7d8c57 refactor: expose plugin utils & add initial tests (#484)
* refactor: expose plugin utils & add initial tests

* fix: plugins work with Node v0.12
2016-07-26 21:32:33 -07:00