-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run the same suite multiple times #3027
Comments
would need the test file to help further |
This is the test file. const request = require('supertest');
const expect = require('chai').expect;
const path = require('path');
describe('attachments', () => {
it('test1', done => {
request('http://services.odata.org')
.get('/TripPinRESTierService/(S(32zs1aehc5ajm1i2fpx3mi2j))/People')
.set("header-header-header-header-header-header", 'header-header-header-header-header-header')
.expect(res => {
expect(res.status, res.text).to.be.within(200, 302);
})
.end(function (err, res) {
done(err);
});
});
it('test2', done => {
request('http://services.odata.org')
.get('/TripPinRESTierService/People(\'keithpinckney\')?$expand=Trips')
.set("header-header-header-header-header-header", 'header-header-header-header-header-header')
.expect(res => {
expect(res.status, res.text).to.be.within(200, 302);
})
.end(function (err, res) {
done(err);
});
});
it('test3', done => {
request('http://services.odata.org')
.get('/TripPinRESTierService/Airports(\'KSFO\')/Location/Address ')
.set("header-header-header-header-header-header", 'header-header-header-header-header-header')
.expect(res => {
expect(res.status, res.text).to.be.within(200, 302);
})
.end(function (err, res) {
done(err);
});
});
}); |
I am a bot that watches issues for inactivity. |
What is going on with this issue? |
I am a bot that watches issues for inactivity. |
Could you provide MCVE to reproduce it. The test files which you provided are depend on your applications, so we can't check it. |
|
Description
I want to run mocha tests programmatically multiple times.
I'm aware of the workaround with deleting require.cache but it works only for a small number of tests.
Steps to Reproduce
Expected behavior:
All 10 runs should pass
Actual behavior:
First 7 runs pass, the last 3 runs fail with error:
TypeError: Cannot read property 'call' of undefined
If I uncomment mocha.suite.suites = [], all tests end right away.
Reproduces how often:
always
Versions
mocha --version: 3.5.3
node node_modules/.bin/mocha --version: 3.5.3
node --version: v6.11.1
The text was updated successfully, but these errors were encountered: