Skip to content

Commit dd34689

Browse files
SimenBcpojer
authored andcommitted
Fix Runtime-sourcemap test (#4744)
* Fix Runtime-sourcemap test * Try new test fix
1 parent eb9f3f8 commit dd34689

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

packages/jest-runtime/src/__tests__/Runtime-sourceMaps-test.js renamed to packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/**
22
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
33
*
4-
* This source code is licensed under the BSD-style license found in the
5-
* LICENSE file in the root directory of this source tree. An additional grant
6-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
76
*
87
* @emails oncall+jsinfra
98
*/
@@ -17,9 +16,10 @@ describe('Runtime', () => {
1716
});
1817

1918
describe('requireModule', () => {
20-
it('installs source maps if available', () =>
21-
createRuntime(__filename).then(runtime => {
22-
let hasThrown = false;
19+
it('installs source maps if available', () => {
20+
expect.assertions(1);
21+
22+
return createRuntime(__filename).then(runtime => {
2323
const sum = runtime.requireModule(
2424
runtime.__mockRootPath,
2525
'./sourcemaps/out/throwing-mapped-fn.js',
@@ -28,20 +28,17 @@ describe('Runtime', () => {
2828
try {
2929
sum();
3030
} catch (err) {
31-
hasThrown = true;
32-
/* eslint-disable max-len */
3331
if (process.platform === 'win32') {
3432
expect(err.stack).toMatch(
35-
/^Error: throwing fn\s+at sum.+\\__tests__\\test_root\\sourcemaps\\throwing-mapped-fn.js:10:9/,
33+
/^Error: throwing fn\s+at sum.+\\__tests__\\test_root\\sourcemaps\\(out\\)?throwing-mapped-fn.js:\d+:\d+/,
3634
);
3735
} else {
3836
expect(err.stack).toMatch(
39-
/^Error: throwing fn\s+at sum.+\/__tests__\/test_root\/sourcemaps\/throwing-mapped-fn.js:10:9/,
37+
/^Error: throwing fn\s+at sum.+\/__tests__\/test_root\/sourcemaps\/(out\/)?throwing-mapped-fn.js:\d+:\d+/,
4038
);
4139
}
42-
/* eslint-enable max-len */
4340
}
44-
expect(hasThrown).toBe(true);
45-
}));
41+
});
42+
});
4643
});
4744
});

0 commit comments

Comments
 (0)