Skip to content

Commit d05c432

Browse files
committed
chore: upgrade to jest 25
1 parent 3b3decf commit d05c432

File tree

7 files changed

+1173
-911
lines changed

7 files changed

+1173
-911
lines changed

fixtures/dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"classnames": "^2.2.5",
1212
"codemirror": "^5.40.0",
1313
"core-js": "^2.4.1",
14-
"jest-diff": "^24.8.0",
14+
"jest-diff": "^25.1.0",
1515
"prop-types": "^15.6.0",
1616
"query-string": "^4.2.3",
1717
"react": "^15.4.1",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"google-closure-compiler": "20190301.0.0",
6464
"gzip-size": "^3.0.0",
6565
"jasmine-check": "^1.0.0-rc.0",
66-
"jest": "^24.9.0",
67-
"jest-diff": "^24.9.0",
66+
"jest": "^25.1.0",
67+
"jest-diff": "^25.1.0",
6868
"jest-snapshot-serializer-raw": "^1.1.0",
6969
"minimatch": "^3.0.4",
7070
"minimist": "^1.2.0",

packages/jest-mock-scheduler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0",
22+
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
2323
"scheduler": "^0.15.0"
2424
},
2525
"files": [

packages/jest-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0",
22+
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
2323
"react": "^16.0.0",
2424
"react-test-renderer": "^16.0.0"
2525
},

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ describe('ReactDOMComponent', () => {
24222422
const container = document.createElement('div');
24232423

24242424
ReactDOM.render(<img src={obj} />, container);
2425-
expect(container.firstChild.src).toBe('hello');
2425+
expect(container.firstChild.src).toBe('http://localhost/hello');
24262426

24272427
ReactDOM.render(<svg arabicForm={obj} />, container);
24282428
expect(container.firstChild.getAttribute('arabic-form')).toBe('hello');
@@ -2456,7 +2456,7 @@ describe('ReactDOMComponent', () => {
24562456
const child = Object.create(parent);
24572457
const el = ReactTestUtils.renderIntoDocument(<img src={child} />);
24582458

2459-
expect(el.src).toBe('hello.jpg');
2459+
expect(el.src).toBe('http://localhost/hello.jpg');
24602460
});
24612461

24622462
it('assigns ajaxify (an important internal FB attribute)', function() {

scripts/jest/config.base.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,4 @@ module.exports = {
2121
collectCoverageFrom: ['packages/**/*.js'],
2222
timers: 'fake',
2323
snapshotSerializers: [require.resolve('jest-snapshot-serializer-raw')],
24-
// Jest changed from `about:blank` to `http://localhost` default in 24.5 (https://github.com/facebook/jest/pull/6792)
25-
// in order to address https://github.com/facebook/jest/issues/6766. If one uses `about:blank` in [email protected] or
26-
// newer, it fails with `SecurityError: localStorage is not available for opaque origins`. However, some of React's
27-
// tests depend on `about:blank` being the domain (for e.g. `url` in `img` tags). So we set `about:blank` here to
28-
// keep the current behavior and make sure to keep the version of JSDOM to version lower than 11.12. This will have
29-
// to be addressed properly when Jest 25 is released, as it will come with a newer version of JSDOM.
30-
testURL: 'about:blank',
3124
};

0 commit comments

Comments
 (0)