1

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

2 Answers2

0

The tests syntax remains the same when using gulp-mocha in compare to simple mocha

Actually, gulp-mocha is just a wrapper to help you run test suites via gulp

Stanislav
  • 486
  • 5
  • 9
0

The ideal way to fix this issue is to make an asynchronous test.

describe('StackOverflowExample', function() {
    it('Demonstrates how to create a test with delay', async function(done) {
        setTimeout(() => {
            //Your code here
            done();
        }, 250); //Set the delay to your liking
    });
});
DevNebulae
  • 4,566
  • 3
  • 16
  • 27