Skip to content

Commit f26ebf0

Browse files
committed
feat: diagnostics, different compilers, ...
1 parent 82d1ce9 commit f26ebf0

51 files changed

Lines changed: 1365 additions & 1448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jspm_packages
4949
tests/simple-long-path/long-src-path
5050
# is linked to the temp dir of the os
5151
e2e/__workdir_synlink__
52+
# while refactoring...
53+
old/
5254

5355
# binaries
5456
*.tgz

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ jspm_packages
4444

4545
# Optional REPL history
4646
.node_repl_history
47+
# while refactoring...
48+
old/
4749

4850
*.tgz

jest.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
module.exports = {
22
rootDir: '.',
33
transform: {
4-
'\\.ts$': '<rootDir>/dist/index.js',
4+
'\\.ts$': '<rootDir>/dist/index.js'
55
},
66
testMatch: ['<rootDir>/src/**/?(*.)+(spec|test).ts?(x)'],
77
collectCoverageFrom: [
88
'<rootDir>/src/**/*.ts',
9+
'!<rootDir>/src/**/*.d.ts',
910
'!<rootDir>/src/**/*.spec.ts',
1011
'!<rootDir>/src/**/*.test.ts',
11-
'!<rootDir>/src/**/__*__/*',
12+
'!<rootDir>/src/**/__*__/*'
1213
],
1314
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
14-
testEnvironment: 'node',
15-
};
15+
testEnvironment: 'node'
16+
}

package-lock.json

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

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,30 @@
3737
"url": "https://github.com/kulshekhar/ts-jest/issues"
3838
},
3939
"homepage": "https://github.com/kulshekhar/ts-jest#readme",
40-
"dependencies": {},
40+
"dependencies": {
41+
"arrify": "^1.0.1",
42+
"buffer-from": "^1.1.1",
43+
"fast-json-stable-stringify": "^2.0.0",
44+
"json5": "^1.0.1",
45+
"make-error": "^1.3.4",
46+
"mkdirp": "^0.5.1",
47+
"yn": "^2.0.0"
48+
},
4149
"peerDependencies": {
4250
"babel-jest": ">=22.0.0 <24.0.0",
4351
"jest": ">=22.0.0 <24.0.0",
4452
"typescript": ">=2.7.0 <4.0.0"
4553
},
4654
"devDependencies": {
55+
"@types/arrify": "^1.0.4",
4756
"@types/babel__core": "^7.0.1",
57+
"@types/buffer-from": "^1.1.0",
4858
"@types/fs-extra": "5.0.4",
4959
"@types/gist-package-json": "git+https://gist.github.com/5c1cc527fe6b5b7dba41fec7fe54bf6e.git",
5060
"@types/jest": "^23.3.1",
61+
"@types/json5": "0.0.29",
5162
"@types/lodash.set": "^4.3.4",
63+
"@types/mkdirp": "^0.5.2",
5264
"@types/node": "^10.5.8",
5365
"@types/semver": "^5.5.0",
5466
"closest-file-data": "^0.1.4",

src/__helpers__/fakers.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { TsJestGlobalOptions, BabelConfig, TsJestConfig } from '../types'
1+
import { TsJestGlobalOptions, BabelConfig, TsJestConfig } from '../lib/types'
22
import { resolve } from 'path'
3-
import { ImportReasons } from '../utils/messages'
3+
import { ImportReasons } from '../lib/messages'
44

55
export function filePath(relPath: string): string {
66
return resolve(__dirname, '..', '..', relPath)
@@ -54,10 +54,13 @@ describe('hello', () => {
5454

5555
export function tsJestConfig(options?: Partial<TsJestConfig>): TsJestConfig {
5656
return {
57-
babelJest: undefined,
57+
version: '0.0.0-mock0',
58+
typeCheck: false,
59+
compiler: 'typescript',
60+
babelConfig: undefined,
5861
tsConfig: undefined,
59-
diagnostics: [],
6062
stringifyContentPathRegex: undefined,
63+
diagnostics: { ignoreCodes: [], pretty: false },
6164
...options,
6265
}
6366
}
@@ -85,6 +88,6 @@ export function babelConfig<T extends BabelConfig>(options?: BabelConfig): T {
8588
} as any
8689
}
8790

88-
export function importReason(text: string = 'because'): ImportReasons {
91+
export function importReason(text: string = '[[BECAUSE]]'): ImportReasons {
8992
return text as any
9093
}

src/__helpers__/mock-there.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default function mockThese(map: string[] | { [k: string]: () => any }) {
22
const isArray = Array.isArray(map)
33
const items: string[] = isArray ? (map as string[]) : Object.keys(map)
44
items.forEach(item => {
5-
const val = isArray ? () => item : map[item]
5+
const val = isArray ? () => item : (map as any)[item]
66
jest.doMock(item, val, { virtual: true })
77
})
88
}

src/__mocks__/ts-program.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/__snapshots__/ts-jest-transformer.spec.ts.snap

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/__snapshots__/ts-program.spec.ts.snap

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)