Merge branch '3.99' into 4.0
This commit is contained in:
@@ -459,6 +459,10 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('copes with async failures after done has been called', function(done) {
|
||||
if (jasmine.getEnv().skipBrowserFlake) {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
var global = {
|
||||
setTimeout: function(fn, delay) {
|
||||
setTimeout(fn, delay);
|
||||
@@ -656,8 +660,8 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
env.execute(null, function() {
|
||||
// Expect >= 9 rather than >= 10 to compensate for clock imprecision
|
||||
expect(duration).toBeGreaterThanOrEqual(9);
|
||||
// Expect > 0 to compensate for clock imprecision
|
||||
expect(duration).toBeGreaterThan(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -1007,6 +1011,10 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('Mock clock can be installed and used in tests', function(done) {
|
||||
if (jasmine.getEnv().skipBrowserFlake) {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
var globalSetTimeout = jasmine
|
||||
.createSpy('globalSetTimeout')
|
||||
.and.callFake(function(cb, t) {
|
||||
@@ -1147,6 +1155,10 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('should not use the mock clock for asynchronous timeouts', function(done) {
|
||||
if (jasmine.getEnv().skipBrowserFlake) {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
createMockedEnv();
|
||||
var reporter = jasmine.createSpyObj('fakeReporter', ['specDone']),
|
||||
clock = env.clock;
|
||||
@@ -1185,6 +1197,10 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('should wait a custom interval before reporting async functions that fail to complete', function(done) {
|
||||
if (jasmine.getEnv().skipBrowserFlake) {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
createMockedEnv();
|
||||
var reporter = jasmine.createSpyObj('fakeReport', [
|
||||
'jasmineDone',
|
||||
@@ -2823,6 +2839,10 @@ describe('Env integration', function() {
|
||||
});
|
||||
|
||||
it('provides custom equality testers to async matchers', function(done) {
|
||||
if (jasmine.getEnv().skipBrowserFlake) {
|
||||
jasmine.getEnv().skipBrowserFlake();
|
||||
}
|
||||
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var specDone = jasmine.createSpy('specDone');
|
||||
|
||||
7
spec/helpers/disableBrowserFlakes.js
Normal file
7
spec/helpers/disableBrowserFlakes.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(function(env) {
|
||||
env.skipBrowserFlake = function() {
|
||||
pending(
|
||||
'Skipping specs that are known to be flaky in browsers in this run'
|
||||
);
|
||||
};
|
||||
})(jasmine.getEnv());
|
||||
@@ -47,3 +47,7 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.SKIP_JASMINE_BROWSER_FLAKES === 'true') {
|
||||
module.exports.helpers.push('helpers/disableBrowserFlakes.js');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user