Questions tagged [gulp-mocha]
21 questions
34
votes
2 answers
How to test an npm module with peerDependencies?
I am new to understand peerDependencies, and I have read the following references seeking as to how to test an npm module contains peerDependencies within its package.json:
Peer Dependencies
Understanding the npm dependency model
Common npm…

Jeff
- 1,917
- 1
- 25
- 43
6
votes
3 answers
how to write to file when using gulp and mocha?
I have a sample gulp task that uses Mocha json reporter. I would like to write that json output to a file. Would appreciate some inputs.
Here is my code:
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var util =…

Bala
- 11,068
- 19
- 67
- 120
5
votes
1 answer
Mocha test runner - option to rerun only failed tests from previous run
Is there an option in Javascript's Mocha test runner to only run tests which failed on the previous run? Is there an easy way to implement that if not? There are a lot of words written about retrying flaky tests but thats not what I want. I want…

Akron
- 1,413
- 2
- 13
- 28
3
votes
0 answers
Code Coverage for ES6 using gulp istanbul
I'm trying to generate istanbul coverage report for my node js es6 application that has mocha tests. I have used isparta to instrument code and also babel to transpile from ES6 to ES5, but unfortunately nothing has worked. Is anyone successful in …

Ajay Srikanth
- 1,095
- 4
- 22
- 43
3
votes
1 answer
Absolute Paths with Gulp Mocha and Browserify
I have a project which is using Browserify and ES6 to handle importing and defining packages. The project is using absolute paths using the 'paths' option when building with Gulp-Browserify.
This works fine for the source code, but now I am…

lobobabysaurus
- 247
- 2
- 10
2
votes
1 answer
Skipped tests in mocha shown pending in report
I am using gulp-mocha to execute my mocha tests with mochawesome-screenshots report
For a particular condition I should skip my test.
But in report and cli those tests are shown pending not skipped
I need to log the test which i skipped to be…

Bharath Kumar S
- 1,410
- 2
- 10
- 29
2
votes
1 answer
Can I get Mocha to not show passed tests?
We just started unit testing at work using Mocha and Karma. We have less than 100 tests, and having to sift through all the passed tests to find the failed ones is already cumbersome. I can't imagine what it'll be like when we have thousands of…

UhHuhOkSure
- 147
- 7
2
votes
3 answers
how to configure gulp-mocha with the following mocha.opts configuration?
I am trying to run mocha with gulp with the configuration existed before.
moch.opts has the following line.
--timeout 999999
--ui tdd
--full-trace
--recursive
--compilers js:babel-register
how to add them here :
gulp.task('test', function()…

Kalai
- 81
- 1
- 3
2
votes
0 answers
SyntaxError in plugin 'gulp-mocha' Unexpected token =
I am getting the following error in Travis-ci when using Node 4.3.2:
SyntaxError in plugin 'gulp-mocha' Unexpected token =
Everything works when using Node 6, but not 4.3.2. Here is the stack trace:
[12:05:11] Starting 'build'...
[12:05:11]…

Daryn
- 3,394
- 5
- 30
- 41
1
vote
0 answers
Does TestCafe end the node process once all tests are run? Reporter makes async calls and they never return
I'm making a custom reporter that uploads files to Slack, shares them and returns the file link to the reporter (to add to the Slack message) but when I try this out in a real test run, the async calls to upload the file and share fire but it looks…

mostlyfabulous
- 31
- 3
1
vote
0 answers
Unexpected token function when running gulp mocha with node 10
I'm using gulp to run mocha tests,
It seems to fail with es7 syntax like async await and stuff,
I'm using node version 10 in which the async await are supported,
when I run test with
mocha test/sample.js
it works , when I run the same via gulp…

Hari
- 452
- 1
- 6
- 16
1
vote
1 answer
How can I use Gulp to show test coverage using gulp-mocha
Please house, I have transpile my code from es6 to es5 using gulp as a task runner. I have done my coverage report with istanbul. It is not showing test coverage after setting it up. below is my code
import gulp from 'gulp';
import loadPlugins from…

Iakhator
- 159
- 2
- 12
1
vote
2 answers
Gulp-Mocha delay before performing test
The normal version of Mocha supports delays before executings tests (link: https://mochajs.org/#hooks).
Is there a way to do this in gulp-mocha?

DevNebulae
- 4,566
- 3
- 16
- 27
1
vote
0 answers
gulp-mocha halts on first failed test
When running gulp-mocha, if an unhandled error occurs during a test, I'd like that specific test to fail, but the remaining tests to continue. Currently, gulp-mocha halts on the first test which throws an error and outputs the error to the console.…

Josh M.
- 26,437
- 24
- 119
- 200
0
votes
1 answer
Running gulp-mocha with mongoose Timeout with missing schema error
After updating gulp-mocha to latest version 6.0.0 all my tests crashed.
mongoose is complaining with MissingSchemaError, all the tests Timeout even after increasing the timer, I cant find whats wrong. It appears setting up Mocha and Mongoose has…

ramon22
- 3,528
- 2
- 35
- 48