Skip to content

Commit 45d44d1

Browse files
authored
Merge branch 'master' into appveyor-optimizations
2 parents 76e2fe5 + 0f31b42 commit 45d44d1

5 files changed

Lines changed: 22 additions & 25 deletions

File tree

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"build": "tsc -p tsconfig.build.json",
1111
"build:watch": "tsc -p tsconfig.build.json -w",
1212
"clean": "node scripts/clean.js",
13-
"pretest": "run-p typecheck lint",
13+
"pretest": "run-s typecheck lint",
1414
"test": "run-s -s test:e2e \"test:unit -- {@}\" --",
1515
"test:prepare": "npm run test:e2e -- --prepareOnly",
1616
"test:e2e": "node scripts/e2e.js",
1717
"test:unit": "jest",
1818
"test:external": "node scripts/test-external-project.js",
19-
"lint": "run-p lint:ts lint:js",
19+
"lint": "run-s lint:ts lint:js",
2020
"lint:js": "eslint . -f stylish",
2121
"lint:ts": "tslint -t stylish --project .",
2222
"lint:fix": "run-s lint:fix:ts lint:fix:js",

src/config/config-set.spec.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { testing } from 'bs-logger'
22
import { resolve } from 'path'
33
import ts, { Diagnostic, ModuleKind, ScriptTarget } from 'typescript'
44

5+
import { version as currentVersion } from '../../package.json'
56
import * as fakers from '../__helpers__/fakers'
67
import { mocked } from '../__helpers__/mocks'
78
import { TsJestGlobalOptions } from '../types'
@@ -20,6 +21,7 @@ backports.backportJestConfig.mockImplementation((_, config) => ({
2021
}))
2122

2223
const defaultResolve = (path: string) => `resolved:${path}`
24+
const pkgVersion = (pkgName: string) => require(`${pkgName}/package.json`).version || '????'
2325

2426
function createConfigSet({
2527
jestConfig,
@@ -314,29 +316,23 @@ describe('readTsConfig', () => {
314316
describe('versions', () => {
315317
describe('without babel', () => {
316318
it('should return correct version map', () => {
317-
expect(createConfigSet().versions).toMatchInlineSnapshot(`
318-
Object {
319-
"jest": "23.6.0",
320-
"ts-jest": "23.10.0-beta.6",
321-
"tslib": "1.9.3",
322-
"typescript": "3.0.3",
323-
}
324-
`)
319+
expect(createConfigSet().versions).toEqual({
320+
jest: pkgVersion('jest'),
321+
'ts-jest': currentVersion,
322+
typescript: pkgVersion('typescript'),
323+
})
325324
})
326325
})
327326
describe('with babel', () => {
328327
it('should return correct version map', () => {
329-
expect(createConfigSet({ tsJestConfig: { babelConfig: {} } }).versions).toMatchInlineSnapshot(`
330-
Object {
331-
"@babel/core": "-",
332-
"babel-core": "6.26.3",
333-
"babel-jest": "23.6.0",
334-
"jest": "23.6.0",
335-
"ts-jest": "23.10.0-beta.6",
336-
"tslib": "1.9.3",
337-
"typescript": "3.0.3",
338-
}
339-
`)
328+
expect(createConfigSet({ tsJestConfig: { babelConfig: {} } }).versions).toEqual({
329+
'@babel/core': '-',
330+
'babel-core': pkgVersion('babel-core'),
331+
'babel-jest': pkgVersion('babel-jest'),
332+
jest: pkgVersion('jest'),
333+
'ts-jest': currentVersion,
334+
typescript: pkgVersion('typescript'),
335+
})
340336
})
341337
})
342338
}) // versions

src/config/config-set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class ConfigSet {
234234

235235
@Memoize()
236236
get versions(): Record<string, string> {
237-
const modules = ['jest', this.tsJest.compiler, 'tslib']
237+
const modules = ['jest', this.tsJest.compiler]
238238
if (this.tsJest.babelConfig) {
239239
modules.push('@babel/core', 'babel-core', 'babel-jest')
240240
}

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
],
77
"linterOptions": {
88
"exclude": [
9+
"package.json",
910
"dist/**/*",
1011
"**/node_modules/**/*",
1112
"e2e/__cases__/**/*"

0 commit comments

Comments
 (0)