Open radiovisual opened 8 years ago
Vorpal Inspiration:
Vorpal.execSync lets you get the output of a command in sync, which is useful, also make use of the intercept function to grab the stdout:
https://github.com/dthree/cash/blob/master/src/util/intercept.js
Vorpal can simulate keypresses with its UI functions: https://github.com/dthree/vorpal/wiki/api-|-vorpal.ui
A ton of UI simulation in the wat tests, I believe, including tests on tabbed completion, etc: https://github.com/dthree/wat/tree/master/test
execa Inspiration:
https://github.com/sindresorhus/detect-indent-cli/blob/master/test.js
Items that need to be tested via the CLI:
API Tests
timecard new
(with existing .timecard.json file, should confirm overwrite)timecard new
(without existing .timecard.json file, shouldn't confirm overwrite)timecard new --no-prompt
(shouldn't confirm overwrite)timecard clockin && timecard clockin
(show show clockout pending error)timecard clockout && timecard clockout
(show show clockin pending error)timecard print
(should print timecard)timecard clockin && timecard print
(should print pending clockout message in output)timecard clockin
(with existing .timecard.json file, should show clockin message)timecard clockout
(with existing .timecard.json file, should show clockout message)timecard print
(with existing .timecard.json file, should print timecard)timecard clockin
(without existing .timecard.json file, shouldn't show error)timecard clockout
(without existing .timecard.json file, shouldn't show error)timecard print
(without existing .timecard.json file, shouldn't show error)timecard clockin
(with invalid .timecard.json file, should show error)timecard clockout
(with invalid .timecard.json file, should show error)timecard print
(with invalid .timecard.json file, should show error)timecard version
(should output version)timecard
(should show help when called with no arguments)timecard help
(should show help)Additional Tests
In a package with a
package.json
file.timecard.json
file no matter how many directories deep the user isIn a package without a
package.json
file.timecard.json
file in the same directory