Comments (15)
@serut Does this problem only occur in watch or even in "single-run" mode?
My expectation is, that it happens also without watch.
from mocha-webpack.
I still don't get it @zinserjan
Not watching
mocha-webpack --webpack-config webpack.test.config.js "@(tests|web_modules)/**/*.test.js{,x}" --recursive
2 passing (52ms)
mocha-webpack --webpack-config webpack.test.config.js "**/@(tests|web_modules)/**/*.test.js{,x}" --recursive
149 passing (730ms)
4 pending
Watching
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "**/{tests,web_modules}/**/*.test.js{,x}" --recursive --watch
2 passing (4s)
0 passing (2ms)
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "**/@(tests|web_modules)/**/*.test.js{,x}" --recursive --watch
2 passing (4s)
0 passing (3ms)
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "web_modules/**/*.test.js{,x}" --recursive --require source-map-support/register --inline-diffs --watch --reporter nyan
147 passing (2s)
4 pending
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "**/web_modules/**/*.test.js{,x}" --recursive --watch
0 passing (2ms)
0 passing (1ms)
from mocha-webpack.
Thanks. The glob matching algorithm is the same for both. The only difference is that the watch mode use also another plugin to detect which tests needs to run. Seems that there is bug in this plugin.
A few days ago I have been started to do a complete rewrite. Watch mode is now identical to the single run mode. I would appreciate it if you can test this again against the current master.
Here are some instructions to get this working:
- delete mocha-webpack from node_modules (no uninstall to keep files in .bin folder intact)
- git clone into node_modules
- cd mocha-webpack
- npm install
- npm run build
- run your tests again
from mocha-webpack.
Thanks it works great !!
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "**/@(tests|web_modules)/**/*.test.js{,x}" --recursive --watch
159 passing (2s)
4 pending
mocha-webpack --timeout 5000 --webpack-config webpack.test.config.js "**/{tests,web_modules}/**/*.test.js{,x}" --recursive --watch
159 passing (3s)
4 pending
from mocha-webpack.
Yay! Sounds great. I'll try to complete the remaining coding tasks for 1.0.0 in the next days and make a prerelease.
Can you also test the in-memory
branch from #83 with your test suite?
from mocha-webpack.
How can I test thein-memory
improvement ? Just in terms of speed ?
from mocha-webpack.
git fetch in-memory
git checkout in-memory
npm run test:mocha
159 passing (358ms)
4 pending
from mocha-webpack.
How can I test the in-memory improvement ?
Test should run and no files are written to .tmp. That's all :)
Just in terms of speed ?
Theoretically yes, but I didn't notice any speed improvements so far.
from mocha-webpack.
Did you run npm install
& npm run build
again?
from mocha-webpack.
Nop. Good catch (.tmp was recreated)
from mocha-webpack.
I don't have the .tmp
folder but I have two new error that I didn't had previously.
157 passing (580ms)
4 pending
2 failing
1) [COMMON] Testing i18n actions Test actions creation for internationalization language change:
Error: Cannot find module './1.bundle.js'
at Function._resolveFilename (node_modules/mocha-webpack/lib/webpack/util/registerRequireHook.js:36:34)
at require (internal/module.js:20:19)
at Function.requireEnsure [as e] (.tmp/mocha-webpack/webpack/bootstrap e12f69137d35a6eb37ff:39:1)
[ my code]
2) [COMMON] Testing i18n actions Test fallback en-US --> en:
Error: Cannot find module './1.bundle.js'
at Function._resolveFilename (node_modules/mocha-webpack/lib/webpack/util/registerRequireHook.js:36:34)
at require (internal/module.js:20:19)
at Function.requireEnsure [as e] (.tmp/mocha-webpack/webpack/bootstrap e12f69137d35a6eb37ff:39:1)
[ my code]
My code is a little bit suxx:
require.ensure([], (require) => {
let messages
try {
// eslint-disable-next-line import/no-dynamic-require
messages = require(`../../../../${messagesDir}/messages.${locale}.i18n.js`)
}
})
It imports a js file dynamically...
I reswitched to master, npm install & npm run build, and my tests are fine
159 passing (388ms)
4 pending
from mocha-webpack.
Are you using code splitting like require.ensure?
from mocha-webpack.
Yes we use code splitting with require.ensure
35 times in our project.
33 on routing (worked great when I tested with in-memory
) and 2 failed (you have the code in my previous comment)
from mocha-webpack.
So sometimes it works with require.ensure
and sometimes not?
Anyway, can you create a minimal failing example? That would be so awesome and helps me alot :)
from mocha-webpack.
So sometimes it works with require.ensure and sometimes not?
It works when the path is static, like
require.ensure([], (require) => {
const ProjectFormContainer = require('./containers/FormContainer')
cb(null, {
content: FormContainer.default,
})
})
but not when it's computed.
from mocha-webpack.
Related Issues (20)
- Error when using `--watch` flag as documented HOT 1
- An in-range update of loader-utils is breaking the build 🚨 HOT 6
- An in-range update of interpret is breaking the build 🚨 HOT 1
- An in-range update of chalk is breaking the build 🚨 HOT 1
- Dies silently HOT 1
- RUNTIME EXCEPTION Exception occurred while loading your tests Cannot read property 'assign' HOT 1
- Compatibility issue with webpack > 4.28.3 HOT 5
- `Mochapack` a fork of `mocha-webpack` released with Mocha 6 support HOT 14
- An in-range update of source-map-support is breaking the build 🚨 HOT 9
- An in-range update of is-glob is breaking the build 🚨 HOT 1
- An in-range update of tiny-worker is breaking the build 🚨 HOT 2
- Cannot find module - VueSSRServerPlugin
- Solved: Mocha 6, Webpack 4, Cyclic dependencies Errors HOT 3
- jsdom is not a function + SecurityError localStorage workaround
- allow-uncaught ?
- Mocha Chai vue testing a vue component : this.$notify is not a function HOT 1
- Conflict: Multiple assets emit to the same filename bundle.js
- WEBPACK Failed to compile with 1 error TypeError: mocha.useColors is not a function HOT 2
- You may need an appropriate loader
- Webpack 5 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mocha-webpack.