Questions tagged [mocha-webpack]

Precompiles server-side webpack bundles before running mocha. Inspired by karma-webpack alternatives usage, but this is for Node.js!

Precompiles your server-side webpack bundles before running mocha. Inspired by karma-webpack alternatives usage, but this is for Node.js!

39 questions
1
vote
1 answer

unable to run command ~$ vue add unit-mocha in vue cli 3

I want to add mocha as a unit testing plugin to my already created vue project, which was built using CLI 3 i.e. vue create myProj this is for vue CLI 3.0.0+, in which my current project is running BELOW IS THE ERROR when i run command ~$ vue add…
wasif_Naquvi
  • 69
  • 1
  • 5
1
vote
1 answer

What is causing this issue: "Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called;."

In the VueJs web application, we have written more than 500 unit test-cases(in all modules) using vue-test-utils and mocha-webpack, using nyc for coverage reports. Consider each module in one directory. When I run test-cases for a particular…
1
vote
1 answer

Testing Single-File Components with Mocha + webpack got RUNTIME EXCEPTION Exception occurred while loading your tests in unit test on vuejs

i have existing project to make unit test with single component but when i compile will got an error. WEBPACK Compiled successfully in 17093ms MOCHA Testing... RUNTIME EXCEPTION Exception occurred while loading your tests SyntaxError:…
priyeshvadhiya
  • 606
  • 3
  • 8
  • 27
1
vote
1 answer

mocha-webpack not finding tests

I can't seem to figure how to get mocha-webpack to detect tests in my folder. I'm running the following command: mocha-webpack --webpack-config test/server/webpack.config-test.js webpack.config-test.js var nodeExternals =…
A. L
  • 11,695
  • 23
  • 85
  • 163
1
vote
0 answers

mocha-webpack compile with Cannot read property 'babel' of undefined

Webpack compilation error when unit testing. I try to modify the test file but still so, it should be webpack configuration problems, test the error component error Webpack compilation error when unit testing. I try to modify the test file but still…
Hank Chan
  • 11
  • 1
1
vote
0 answers

mocha-webpack - RUNTIME EXCEPTION Exception occurred while loading your tests

I am getting this error when running my tests: RUNTIME EXCEPTION Exception occurred while loading your tests TypeError: Cannot read property 'indexOf' of undefined at…
jordan
  • 9,570
  • 9
  • 43
  • 78
1
vote
1 answer

istanbul with mocha-webpack missing sourcemaps

I'm building a project that uses mocha-webpack to test an Angular 2 project, and I'm trying to add coverage to the project using Istanbul's command line (nyc), but I can't figure out how to get Istanbul to correctly display the covered source when…
Skeeterdrums
  • 460
  • 1
  • 6
  • 13
1
vote
0 answers

mocha-webpack unit test with superagent

I use mocha-webpack for unit test an external api and I use superAgent for my ajax request. I make 2 test: const request = require("superagent"); var chai = require('chai') , expect = chai.expect , should = chai.should(); var…
Seb
  • 404
  • 2
  • 4
  • 14
0
votes
0 answers

mochapack Cannot assign to read only property 'exports' of object

I would like to create a vuejs unit test for components. I follow this official tutorial vuejs : Vuejs component unit test I have created those file : setup.js (main script for all test) : require('jsdom-global')() global.expect =…
miltone
  • 4,416
  • 11
  • 42
  • 76
0
votes
1 answer

Vue + Mocha, 0 test passing if vue singlefile has