Silence tests unsupported in PhantomJS.

These tests can still be run in the browser using `grunt test --debug`.

This is a repeat of 42f8d155f8. For posterity, we
do this because Phantom has a problem with Object.freeze and the test runner
can't do __DEV__ right (because we get rid of that in the build step).
This commit is contained in:
Paul O’Shannessy
2014-03-18 17:48:16 -07:00
parent e505e47e01
commit b95fbbe4a2
@@ -141,6 +141,7 @@ describe('ImmutableObject', function() {
testDevAndProd(
'should create distinct object with shallow field insertion',
function() {
if (window.callPhantom) return;
var beforeStructure = {
oldShallowField: {
deepField: {
@@ -172,6 +173,7 @@ describe('ImmutableObject', function() {
testDevAndProd(
'should create distinct object with shallow field mutation',
function() {
if (window.callPhantom) return;
var beforeStructure = {
oldShallowField: {
deepField: {
@@ -197,6 +199,7 @@ describe('ImmutableObject', function() {
message = 'should create distinct object with deep field insertion';
testDevAndProd(message, function() {
if (window.callPhantom) return;
var beforeStructure = {
oldShallowField: {
deepField: {
@@ -244,6 +247,7 @@ describe('ImmutableObject', function() {
message = 'should provide a setProperty interface as sugar for set()';
testDevAndProd(message, function() {
if (window.callPhantom) return;
var beforeIO = new ImmutableObject({initialField: null});
var afterIO =
ImmutableObject.setProperty(beforeIO, 'anotherField', 'anotherValue');
@@ -256,6 +260,7 @@ describe('ImmutableObject', function() {
message = 'should recursively create distinct objects when deep copying';
testDevAndProd(message, function() {
if (window.callPhantom) return;
var beforeIO = new ImmutableObject({
a: {b: 'b', c: {}, d: 'd', e: new ImmutableObject({f: 'f'}) }
});
@@ -271,6 +276,7 @@ describe('ImmutableObject', function() {
});
testDevAndProd('should deep copy member immutability', function() {
if (window.callPhantom) return;
var beforeIO = new ImmutableObject({
a: {b: new ImmutableObject({c: 'c'}), e: {f: 'f'}}
});