Skip to content

Commit

Permalink
handle missing sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jul 10, 2019
1 parent 2aa68b3 commit 9dad3a2
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 124,576 deletions.
21 changes: 21 additions & 0 deletions e2e/__tests__/v8Coverage.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import path from 'path';
import runJest from '../runJest';

const DIR = path.resolve(__dirname, '../v8-coverage');

test('does not explode on missing sourcemap', () => {
const sourcemapDir = path.join(DIR, 'no-sourcemap');
const {stderr, status} = runJest(sourcemapDir, ['--v8-coverage'], {
stripAnsi: true,
});

expect(stderr).not.toContain('no such file or directory');
expect(status).toBe(0);
});
7 changes: 0 additions & 7 deletions e2e/v8-coverage/__tests__/test.js

This file was deleted.

3 changes: 3 additions & 0 deletions e2e/v8-coverage/no-sourcemap/Thing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('./x.css');

module.exports = 42;
4 changes: 4 additions & 0 deletions e2e/v8-coverage/no-sourcemap/__tests__/Thing.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const Thing = require('../Thing');

console.log(Thing);
test.todo('whatever');
4 changes: 4 additions & 0 deletions e2e/v8-coverage/no-sourcemap/cssTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
getCacheKey: () => 'cssTransform',
process: () => 'module.exports = {};',
};
10 changes: 10 additions & 0 deletions e2e/v8-coverage/no-sourcemap/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "no-sourcemap",
"version": "1.0.0",
"jest": {
"transform": {
"^.+\\.[jt]sx?$": "babel-jest",
"^.+\\.css$": "<rootDir>/cssTransform.js"
}
}
}
Empty file.
8 changes: 0 additions & 8 deletions e2e/v8-coverage/package.json

This file was deleted.

0 comments on commit 9dad3a2

Please sign in to comment.