Questions tagged [gulp-mocha]

21 questions
0
votes
1 answer

pass variable from gulp file to mocha test file

I am trying execute mocha test file through gulp using gulp-mocha. Such that I need variable to be passed(or pipe) to mocha test file which can be accessed in mocha test file. How can I achieve this one
Dorjon
  • 1
0
votes
1 answer

How to call specific test cases from one file to another file

I'm new to Mocha. I want to call Test case 2 from a.js file to b.js like import the test case because of same test cases repeatable in the b.js file. Example File a.js : describe('Sample a',function(){ it('Test case1',function(done){ …
VVV
  • 68
  • 1
  • 14
0
votes
2 answers

Writing Mocha Test for Async functions which uses setTimeout()

Somehow I'm not able to write Mocha JS test for a relatively very simple function. The JavaScript Source file looks like this exports.cb = function() { console.log("The function is called after 3 seconds"); } exports.testfn = function(cb) { …
Daksh Gupta
  • 7,554
  • 2
  • 25
  • 36
0
votes
2 answers

How to exit gulp when unit test broken?

I am using gulp and mocha to run unit tests which is part of a gulp workflow to run my reactjs app. The unit test works: gulp.task('mocha', function () { return gulp .src(['test/*.js']) .pipe(mocha({ compilers: { …
bier hier
  • 20,970
  • 42
  • 97
  • 166
0
votes
0 answers

coverage report generation fails: mocha > gulp-mocha > gulp-istanbul

I'm using gulp-mocha and gulp-istanbul to pipe mocha run through to istanbul for coverage collection. I'm using done(error) to denote a test fail in mocha test cases. When all tests pass, istanbul runs coverage collection and produces reports. When,…
JayabalanAaron
  • 360
  • 3
  • 13
0
votes
0 answers

Create database for test with mocha

whats up? I have this struct in my project: https://i.stack.imgur.com/kKmkw.jpg I have the file database.js which is some connection methods. (https://github.com/viniciusmurad/genericProject-node/blob/master/config/database.js) In my server.js file…
Gansonic
  • 347
  • 4
  • 15
1
2