Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 54ad467

Browse filesBrowse files
authored
Recovered some integration tests (#10091)
1 parent 580ed5d commit 54ad467
Copy full SHA for 54ad467

File tree

8 files changed

+27
-22
lines changed
Filter options

8 files changed

+27
-22
lines changed

‎packages/react-dev-utils/package.json

Copy file name to clipboardExpand all lines: packages/react-dev-utils/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
},
8080
"devDependencies": {
8181
"cross-env": "^7.0.2",
82-
"jest": "26.4.2"
82+
"jest": "26.6.0"
8383
},
8484
"scripts": {
8585
"test": "cross-env FORCE_COLOR=true jest"

‎packages/react-error-overlay/src/__tests__/extract-source-map.js

Copy file name to clipboardExpand all lines: packages/react-error-overlay/src/__tests__/extract-source-map.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ test('extracts last source map directive', async () => {
1616
});
1717

1818
test('errors when no source map', async () => {
19-
expect.assertions(1);
20-
2119
const testFileName = 'test.js';
20+
let error;
2221
try {
2322
await extractSourceMapUrl(
2423
testFileName,
2524
`console.log('hi')\n\nconsole.log('bye')`
2625
);
2726
} catch (e) {
28-
expect(e).toBe(`Cannot find a source map directive for ${testFileName}.`);
27+
error = e;
2928
}
29+
expect(error).toBe(`Cannot find a source map directive for ${testFileName}.`);
3030
});

‎packages/react-error-overlay/src/__tests__/get-source-map.js

Copy file name to clipboardExpand all lines: packages/react-error-overlay/src/__tests__/get-source-map.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ test('error on a source map with unsupported encoding', async () => {
5252
const file = fs
5353
.readFileSync(resolve(__dirname, '../../fixtures/junk-inline.mjs'))
5454
.toString('utf8');
55+
let error;
5556
try {
5657
await getSourceMap('/', file);
5758
} catch (e) {
58-
expect(e instanceof Error).toBe(true);
59-
expect(e.message).toBe(
60-
'Sorry, non-base64 inline source-map encoding is not supported.'
61-
);
59+
error = e;
6260
}
61+
expect(error instanceof Error).toBe(true);
62+
expect(error.message).toBe(
63+
'Sorry, non-base64 inline source-map encoding is not supported.'
64+
);
6365
});

‎packages/react-error-overlay/src/__tests__/parser/generic.js

Copy file name to clipboardExpand all lines: packages/react-error-overlay/src/__tests__/parser/generic.js
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@
88
import { parse } from '../../utils/parser';
99

1010
test('throws on null', () => {
11-
expect.assertions(2);
11+
let error;
1212
try {
1313
parse(null);
1414
} catch (e) {
15-
expect(e instanceof Error).toBe(true);
16-
expect(e.message).toBe('You cannot pass a null object.');
15+
error = e;
1716
}
17+
expect(error instanceof Error).toBe(true);
18+
expect(error.message).toBe('You cannot pass a null object.');
1819
});
1920

2021
test('throws on unparsable', () => {
21-
expect.assertions(2);
22+
let error;
2223
try {
2324
parse({});
2425
} catch (e) {
25-
expect(e instanceof Error).toBe(true);
26-
expect(e.message).toBe(
27-
'The error you provided does not contain a stack trace.'
28-
);
26+
error = e;
2927
}
28+
expect(error instanceof Error).toBe(true);
29+
expect(error.message).toBe(
30+
'The error you provided does not contain a stack trace.'
31+
);
3032
});

‎packages/react-scripts/config/jest/babelTransform.js

Copy file name to clipboardExpand all lines: packages/react-scripts/config/jest/babelTransform.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// @remove-file-on-eject
1+
// @remove-on-eject-begin
22
/**
33
* Copyright (c) 2014-present, Facebook, Inc.
44
*
55
* This source code is licensed under the MIT license found in the
66
* LICENSE file in the root directory of this source tree.
77
*/
8+
// @remove-on-eject-end
89
'use strict';
910

1011
const babelJest = require('babel-jest');

‎packages/react-scripts/fixtures/kitchensink/template.json

Copy file name to clipboardExpand all lines: packages/react-scripts/fixtures/kitchensink/template.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"package": {
33
"dependencies": {
44
"bootstrap": "4.3.1",
5-
"jest": "26.4.2",
5+
"jest": "26.6.0",
66
"node-sass": "4.x",
77
"normalize.css": "7.0.0",
88
"prop-types": "15.7.2",

‎packages/react-scripts/fixtures/kitchensink/template/integration/webpack.test.js

Copy file name to clipboardExpand all lines: packages/react-scripts/fixtures/kitchensink/template/integration/webpack.test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('Integration', () => {
8686
doc = await initDOM('image-inclusion');
8787

8888
expect(doc.getElementById('feature-image-inclusion').src).toMatch(
89-
/^data:image\/jpeg;base64.+==$/
89+
/^data:image\/jpeg;base64.+=$/
9090
);
9191
});
9292

‎packages/react-scripts/scripts/utils/createJestConfig.js

Copy file name to clipboardExpand all lines: packages/react-scripts/scripts/utils/createJestConfig.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ module.exports = (resolve, rootDir, isEjecting) => {
4141
testEnvironment: 'jsdom',
4242
testRunner: require.resolve('jest-circus/runner'),
4343
transform: {
44-
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': isEjecting
45-
? '<rootDir>/node_modules/babel-jest'
46-
: resolve('config/jest/babelTransform.js'),
44+
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': resolve(
45+
'config/jest/babelTransform.js'
46+
),
4747
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
4848
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': resolve(
4949
'config/jest/fileTransform.js'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.