No change in production logic.
This adds missing tests to improve test coverage. This does not change
ShellJS behavior at all--all test cases are testing already-working
functionality.
One test case has been renamed for clarity.
For the "omit directory if missing recursive flag" case, we were
actually already testing that in another case, but we were testing
multiple things in that test case. It's better to test this one error
condition explicitly in its own case.
When adding real tests for `parseOptions()`, we need to explicitly clear
`common.state.error` because we're testing an internal function, not a
wrapped command.
Partial fix for #671
* feat: -L (follow symlinks) option for ls
* test: ls -L option
* docs: Add ls -L option to readme
* fix: ls -L ternary operator
* Revert "test: ls -L option"
This reverts commit dbb057ac087b23aa2c1358018d3c832dd546c5f2.
* test: ls -L option
* test: Remove duplicate test
* feature: add -a option for which command
* chore(test): test which -a with unexisting name
* chore(test): check which -a has same result as regular one
* chord(test): fix errors mentioned by eslint
Adds tests to make sure that non-normalized paths (i.e. path/to/./dir) are
valid for a few commands, including mkdir() which previously failed when given
the -p flag.
Fixes#634
* test: set up ava and move cd.js
Set up ava as the new test framework. Migrate the tests for the cd command to
use the ava framework.
* refactor: reorder imports, remove useless dep
* fix: maxdepth doesn't limit total number of copies
Prevent maxdepth from limiting the total number of copies, only allow it to
limit the maximum depth
Fixes#547
* refactor: make `depth` be its own argument
* Get pipe tests running on Windows.
I used the FIND command which ships with Windows as something to
pass data through.
The test checks that a POSIX-like find(1) exists and skips the tests
if this condition is true because Windows-provided FIND is incompatible
with find(1).
* Remove obvious comments.
Requested by @nfischer. I removed both the unix-specific and Windows
specific comments because I figure they both fall under being too
obvious based on being in the process.platform conditional.
* Make FIND usage cleaner and document it.
* Use shx grep to make pipe tests portable.
Discussed in #550. To test piping and its interaction with
real processes, a shellout is necessary. But on Windows,
you cannot rely on utilities like grep(1) being around.
Using shx, we can write portable code. Otherwise, the
tests have to be conditional on the platform and be
way more complicated.