Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@mochify/cli
Advanced tools
Install the package from npm:
npm i @mochify/cli -D
which will make mochify
command available:
mochify [options] <spec...>
The Mochify CLI can pick up configuration from files or CLI flags.
File config can be provided through package.json
or in JavaScript or JSON files and is resolved using the default lookup mechanism specified by lilconfig
.
For example, you could either put configuration in a top-level mochify
key in package.json for static values or a mochify.config.js
for dynamic ones, and have them being picked up automatically.
In case an option is present in both the config file and as a CLI flag, the flag takes precedence.
Refer to the documentation of @mochify/mochify
for available configuration options.
--config
, -C
Override the default lookup and use the file as the source of configuration.
--driver
, -D
The driver to use for running the tests.
Drivers published to the @mochify scope can be referenced using their suffix only (e.g. puppeteer
), third-party or local drivers will need to use the full package name or file path.
Drivers need to be installed separately from the Mochify CLI.
--driver-option
Free form options to pass to the driver in use. Pass an arbitrary number of options using --driver-option.foo 1 --driver-option.bar 2
. Refer to the documentation of the driver in use for available options.
--reporter
, -R
The Mocha reporter to use. Right now, only reporters that are included with Mocha itself can be used.
--bundle
, -B
The command used for bundling the given spec.
The called executable is expected to be installed by the consumer.
In case no bundle command is given and --esm is not used, spec files will be concatenated instead of bundling before running the test suite.
The command will receive the resolved value of <spec...>
.
--esm
Run a local web server and inject all files in the spec as <script type="module">
instead of bundling.
The server serves the contents of the current working directory unless --serve
is given, in which case the contents of the given location will be served instead.
--serve
, -S
Run the tests in the context of a local web server. Files in the given directory will be served as static assets.
--server-option
Options to pass to the server in case --serve
or --esm
is being used.
Currently only --server-option.port
for passing the port to use is supported.
The spec
argument can be a list of files or a glob pattern that will be resolved by Mochify.
mochify ./src/foo.test.js ./src/bar.test.js
mochify ./src/*.test.js # Let the shell handle glob expansion
mochify "./src/*.test.js" # Let Mochify handle glob expansion
stdin
When given -
as the spec, Mochify expects to read a bundled test suite from stdin
:
browserify -t babelify ./src/*.test.js | mochify -
FAQs
Run mocha tests in headless browsers from the command line
We found that @mochify/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.