Skip to content

Commit 670da2b

Browse files
committedFeb 24, 2017
tweak docs, tests
1 parent 6a3ac5d commit 670da2b

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
 

‎docs/Configuration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,18 @@ Note that, if you specify a global reference value (like an object or array) her
152152

153153
### `mapCoverage` [boolean]
154154

155-
##### available in Jest **19.0.0+**
155+
##### available in Jest **20.0.0+**
156156

157157
Default: `false`
158158

159159
If you have [transformers](#transform-object-string-string) configured that emit source maps, Jest will use them to map code coverage against the original source code when writing [reports](#coveragereporters-array-string) and checking [thresholds](#coveragethreshold-object). This can be resource-intensive. If Jest is taking a long time to calculate coverage at the end of a test run, try setting this option to `false`.
160160

161-
Both inline source maps and source maps returned directly from a transformer are supported. Source map URLs are not supported because Jest may not be able to locate them. To return source maps from a transformer, the `process` function can return an object like the following. The sourceMap property may either be an object, or a string of JSON.
161+
Both inline source maps and source maps returned directly from a transformer are supported. Source map URLs are not supported because Jest may not be able to locate them. To return source maps from a transformer, the `process` function can return an object like the following. The `map` property may either be the source map object, or the source map object as a JSON string.
162162

163163
```js
164164
return {
165-
content: 'the code',
166-
sourceMap: 'the source map',
165+
code: 'the code',
166+
map: 'the source map',
167167
};
168168
```
169169

‎packages/jest-runtime/src/__tests__/transform-test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ describe('transform', () => {
226226
expect(vm.Script.mock.calls[2][0]).toMatchSnapshot();
227227
});
228228

229-
it('instruments with source map if preprocessor supplies it', () => {
229+
it('writes source map if preprocessor supplies it', () => {
230230
config = Object.assign(config, {
231231
collectCoverage: true,
232232
mapCoverage: true,
@@ -252,7 +252,7 @@ describe('transform', () => {
252252
);
253253
});
254254

255-
it('instruments with source map if preprocessor inlines it', () => {
255+
it('writes source map if preprocessor inlines it', () => {
256256
config = Object.assign(config, {
257257
collectCoverage: true,
258258
mapCoverage: true,
@@ -279,7 +279,7 @@ describe('transform', () => {
279279
);
280280
});
281281

282-
it('does not instrument with source map if mapCoverage config option is false', () => {
282+
it('does not write source map if mapCoverage config option is false', () => {
283283
config = Object.assign(config, {
284284
collectCoverage: true,
285285
mapCoverage: false,
@@ -292,8 +292,8 @@ describe('transform', () => {
292292
};
293293

294294
require('preprocessor-with-sourcemaps').process.mockReturnValue({
295-
content: 'content',
296-
sourceMap,
295+
code: 'content',
296+
map,
297297
});
298298

299299
const result = transform('/fruits/banana.js', config);

‎types/TestResult.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type RawFileCoverage = {|
2121
statementMap: { [statementId: number]: any },
2222
branchMap: { [branchId: number]: any },
2323
inputSourceMap?: Object,
24-
inputSourceMapPath?: string,
2524
|};
2625

2726
export type RawCoverage = {

0 commit comments

Comments
 (0)