Pend environment-specific specs rather than passing
This commit is contained in:
@@ -2,8 +2,7 @@ describe('base helpers', function() {
|
|||||||
describe('isError_', function() {
|
describe('isError_', function() {
|
||||||
it('correctly handles WebSocket events', function(done) {
|
it('correctly handles WebSocket events', function(done) {
|
||||||
if (typeof jasmine.getGlobal().WebSocket === 'undefined') {
|
if (typeof jasmine.getGlobal().WebSocket === 'undefined') {
|
||||||
done();
|
pending('Environment does not provide WebSocket');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const obj = (function() {
|
const obj = (function() {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ describe('buildExpectationResult', function() {
|
|||||||
|
|
||||||
it('handles nodejs assertions', function() {
|
it('handles nodejs assertions', function() {
|
||||||
if (typeof require === 'undefined') {
|
if (typeof require === 'undefined') {
|
||||||
return;
|
pending('This test only runs in Node');
|
||||||
}
|
}
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const value = 8421;
|
const value = 8421;
|
||||||
|
|||||||
@@ -250,10 +250,6 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('passes for equivalent Promises (GitHub issue #1314)', function() {
|
it('passes for equivalent Promises (GitHub issue #1314)', function() {
|
||||||
if (typeof Promise === 'undefined') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const p1 = new Promise(function() {}),
|
const p1 = new Promise(function() {}),
|
||||||
p2 = new Promise(function() {}),
|
p2 = new Promise(function() {}),
|
||||||
matchersUtil = new jasmineUnderTest.MatchersUtil();
|
matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
@@ -263,14 +259,13 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('when running in a browser', function() {
|
describe('when running in a browser', function() {
|
||||||
function isNotRunningInBrowser() {
|
beforeEach(function() {
|
||||||
return typeof document === 'undefined';
|
if (typeof document === 'undefined') {
|
||||||
}
|
pending('This test only runs in browsers');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('passes for equivalent DOM nodes', function() {
|
it('passes for equivalent DOM nodes', function() {
|
||||||
if (isNotRunningInBrowser()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const a = document.createElement('div');
|
const a = document.createElement('div');
|
||||||
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
|
|
||||||
@@ -285,9 +280,6 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('passes for equivalent objects from different frames', function() {
|
it('passes for equivalent objects from different frames', function() {
|
||||||
if (isNotRunningInBrowser()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
@@ -299,9 +291,6 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('fails for DOM nodes with different attributes or child nodes', function() {
|
it('fails for DOM nodes with different attributes or child nodes', function() {
|
||||||
if (isNotRunningInBrowser()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
const a = document.createElement('div');
|
const a = document.createElement('div');
|
||||||
a.setAttribute('test-attr', 'attr-value');
|
a.setAttribute('test-attr', 'attr-value');
|
||||||
@@ -325,14 +314,13 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('when running in Node', function() {
|
describe('when running in Node', function() {
|
||||||
function isNotRunningInNode() {
|
beforeEach(function() {
|
||||||
return typeof require !== 'function';
|
if (typeof require !== 'function') {
|
||||||
}
|
pending('This test only runs in Node');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('passes for equivalent objects from different vm contexts', function() {
|
it('passes for equivalent objects from different vm contexts', function() {
|
||||||
if (isNotRunningInNode()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
const vm = require('vm');
|
const vm = require('vm');
|
||||||
const sandbox = {
|
const sandbox = {
|
||||||
@@ -344,9 +332,6 @@ describe('matchersUtil', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('passes for equivalent arrays from different vm contexts', function() {
|
it('passes for equivalent arrays from different vm contexts', function() {
|
||||||
if (isNotRunningInNode()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
const matchersUtil = new jasmineUnderTest.MatchersUtil();
|
||||||
const vm = require('vm');
|
const vm = require('vm');
|
||||||
const sandbox = {
|
const sandbox = {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ describe('toThrowError', function() {
|
|||||||
|
|
||||||
it('passes if thrown is an instanceof Error regardless of global that contains its constructor', function() {
|
it('passes if thrown is an instanceof Error regardless of global that contains its constructor', function() {
|
||||||
if (isNotRunningInBrowser()) {
|
if (isNotRunningInBrowser()) {
|
||||||
return;
|
pending('This test only runs in browsers.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const matcher = jasmineUnderTest.matchers.toThrowError();
|
const matcher = jasmineUnderTest.matchers.toThrowError();
|
||||||
|
|||||||
Reference in New Issue
Block a user