Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Try new test fix
  • Loading branch information
SimenB committed Oct 22, 2017
commit fd88a1067afd7f4a1ac8594fa10379dcdc718414
23 changes: 10 additions & 13 deletions packages/jest-runtime/src/__tests__/Runtime-sourceMaps.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails oncall+jsinfra
*/
Expand All @@ -17,9 +16,10 @@ describe('Runtime', () => {
});

describe('requireModule', () => {
it('installs source maps if available', () =>
createRuntime(__filename).then(runtime => {
let hasThrown = false;
it('installs source maps if available', () => {
expect.assertions(1);

return createRuntime(__filename).then(runtime => {
const sum = runtime.requireModule(
runtime.__mockRootPath,
'./sourcemaps/out/throwing-mapped-fn.js',
Expand All @@ -28,20 +28,17 @@ describe('Runtime', () => {
try {
sum();
} catch (err) {
hasThrown = true;
/* eslint-disable max-len */
if (process.platform === 'win32') {
expect(err.stack).toMatch(
/^Error: throwing fn\s+at sum.+\\__tests__\\test_root\\sourcemaps\\throwing-mapped-fn.js:/,
/^Error: throwing fn\s+at sum.+\\__tests__\\test_root\\sourcemaps\\(out\\)?throwing-mapped-fn.js:\d+:\d+/,
);
} else {
expect(err.stack).toMatch(
/^Error: throwing fn\s+at sum.+\/__tests__\/test_root\/sourcemaps\/throwing-mapped-fn.js:/,
/^Error: throwing fn\s+at sum.+\/__tests__\/test_root\/sourcemaps\/(out\/)?throwing-mapped-fn.js:\d+:\d+/,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node 8 was correct, but node 4 and 6 access out. Is that supposed to happen? Feels like it wasn't passed through sourcemap support, then...

);
}
/* eslint-enable max-len */
}
expect(hasThrown).toBe(true);
}));
});
});
});
});