mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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'}}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user