Skip to content

Commit

Permalink
Fix tests on CI to account for prop-types change
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jun 15, 2017
1 parent a3d0dbc commit 7efd2e5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@ function typeCheckPass(declaration, value) {
expect(error).toBe(null);
}

function resetWarningCache() {
jest.resetModules();
PropTypes = require('ReactPropTypes');
React = require('React');
ReactFragment = require('ReactFragment');
ReactTestUtils = require('ReactTestUtils');
ReactPropTypesSecret = require('ReactPropTypesSecret');
}

function expectWarningInDevelopment(declaration, value) {
resetWarningCache();
var props = {testProp: value};
var propName = 'testProp' + Math.random().toString();
var componentName = 'testComponent' + Math.random().toString();
Expand All @@ -105,11 +115,7 @@ function expectWarningInDevelopment(declaration, value) {

describe('ReactPropTypes', () => {
beforeEach(() => {
PropTypes = require('ReactPropTypes');
React = require('React');
ReactFragment = require('ReactFragment');
ReactTestUtils = require('ReactTestUtils');
ReactPropTypesSecret = require('ReactPropTypesSecret');
resetWarningCache();
});

describe('Primitive Types', () => {
Expand Down

0 comments on commit 7efd2e5

Please sign in to comment.