v2.0.0 - Config
See original GitHub issueHi,
I am confused as to how to use mochapack v2.0.0. Any doc would be useful on how to pass the config, and what config options are available. Previously, I used mochapack.opts file and provided the same as cli args -
mochapack --opts test/mochapack.opts
The file contents include
--require "@babel/register"
--require "jsdom-global/register"
--require "test/setup.js"
--recursive
"src/**/test/**/*.spec.js" "src/**/*.vue"
--reporter "spec"
--webpack-config test/webpack.config.js
Now, if I run the same way I get exception - WebpackOptionsValidationError: Invalid configuration object.
Tried with
mochapack --webpack-config test/webpack.config.js
Now, webpack config is loaded properly, but how/where do you specify my root .mocharc.json file. Contents are below -
{
"extension": ["js", "vue"],
"require": ["@babel/register", "jsdom-global/register", "test/setup.js"],
"reporter": "spec",
"spec": ["src/**/test/**/*.spec.js", "src/**/*.vue"],
"recursive": true
}
The problem with mocharc.json file in root folder - No tests are running.
@Jack-Barry -> Thanks for all your help!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HuskyCrates v2.0.0 Configuration Basics - YouTube
HuskyCrates v2. 0.0 Configuration Basics. 5.2K views 4 years ago. codeHusky. codeHusky. 8.37K subscribers. Join. Subscribe. 41. I like this.
Read more >Migrating to v2.0.0 - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Release notes v2.0.0 - ProGlove Documentation
Release notes v2.0.0 ... This section presents the features introduced or enhanced in the Gateway v2.0.0 release. Remote Config. Full support for the...
Read more >Homestead v2.0.0 configuration - gists · GitHub
Homestead v2.0.0 configuration. GitHub Gist: instantly share code, notes, and snippets.
Read more >CFB config issue NCS V2.0.0 - Nordic Q&A
Hi, I am trying to compile the cfb sample as provided in v2.0.0. /opt/nordic/ncs/v2.0.0/zephyr/samples/subsys/display/cfb my overlay file is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Resolved the issue by passing the following config in package.json scripts under test -
NODE_ENV=test mochapack --config .mocharc.json --webpack-config test/webpack.config.js \"src/**/test/**/*.spec.js\"
I had to pass the location of mocha config file and webpack config file with the glob to run the tests. Now, the mocha config file contains --require scripts.
Like I stated, some doc/info (in README) on how to pass the config would be helpful. Yet to figure, if we could have all the args in a mochapack config file, or what the file name would be etc…
I ran into this issue as well.
--opts
is not handled properly with mocha v7 nor does it pick up the default.mocharc.js
when running through mochapack. But passing--config .mocharc.js --webpack-config ____
got it to work.