-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation succeeds but test finish immediately #278
Comments
I have exactly the same issue! |
@4lph4-Ph4un I believe TSC is emitting compiled files with aliases that mocha-webpack cannot interpret. I may have been mistaken in my assumption that mocha-webpack had a loader for them. |
@jglover I had the same error. But I fixed this by using the --recursive tag for mocha-webpack directly. I (wrongly) assumed it was using my old mocha.opts but it uses it's own config. Hope this helps. |
@jglover I had the same issue. Unexpectedly, I found swapping my single quotes |
@jglover @4lph4-Ph4un I had the same issue with "webpack@4.28.3" and "mocha-webpack@2.0.0-beta.0". Have you fix it ? Any suggestion ? |
I'm in the same boat, anyone knows what caused this? |
For me, it seemed to be something to do with "Single File Components" in Vue and SCSS processing. // In my webpack-test-config.js
const newRules = config.module.rules.reduce((memo, r) => {
if (r.test === undefined) return memo
if (r.test.test('.css') || r.test.test('.scss')) return memo
memo.push(r)
return memo
}, [])
newRules.push({ test: /.(s)?css$/, loader: 'null-loader' })
config.module.rules = newRules
module.exports = config Fixed my problem, however, I'm working on a large private project and I'm unable to share the code to help resolve the bug :( |
@anlek That tip did it for me! I used a null-loader in my webpack.mocha.js config file
Then specified that config file for mochapack to use. This is is my line in
|
Hi,
I'm running mocha-webpack in order to utilise path aliasing in Webpack/Typescript TSC and I'm running into an issue where Webpack compilation succeeds but Mocha returns immediately with:
0 Passing. Tests completed successfully
I was previously using the following command to run mocha over the compiled js, which ran without problem.
node_modules/.bin/mocha --require source-map-support/register mocha-setup.js 'compiled/**/*-spec.js'
I've now changed mocha out for mocha-webpack as follows
node_modules/.bin/mocha-webpack --webpack-config webpack.config.js --require source-map-support/register mocha-setup.js 'compiled/**/*-spec.js'
packages are "webpack": "4.12.1" and "mocha-webpack": "2.0.0-beta.0"
I'm unsure what I'm missing, much appreciate any help!
The text was updated successfully, but these errors were encountered: