-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
6,195 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "ts-jest-debug", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "jest --config ./test/jest.config.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function echo(shout: string) { | ||
console.log('WITHIN SOURCE'); | ||
if (process.env.__FORCE_FAIL) { | ||
throw new Error('WITHIN SOURCE'); | ||
} | ||
return shout; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { echo } from '../src/echo'; | ||
|
||
describe('echo', () => { | ||
it('echoes', () => { | ||
console.log('WITHIN TEST'); | ||
expect(echo('repeat')).toEqual('repeat'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"moduleFileExtensions": ["js", "json", "ts"], | ||
"roots": ["../src", "."], | ||
"testRegex": ".spec.ts$", | ||
"transform": { | ||
"^.+\\.(t|j)s$": "ts-jest" | ||
}, | ||
"coverageDirectory": "./coverage", | ||
"testEnvironment": "node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"lib": [ | ||
"es2015", | ||
"dom" | ||
] | ||
}, | ||
"include": [ | ||
"../src/**/*", | ||
"**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"declaration": true, | ||
"strict": true, | ||
"sourceMap": true, | ||
"outDir": "./dist", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"target": "es6", | ||
"lib": [ | ||
"es2015", | ||
"es2017", | ||
"dom" | ||
] | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
TestRunResultFlag, | ||
TestRunResult, | ||
sanitizeOutput, | ||
} from '../__helpers__/test-case'; | ||
|
||
export const test = (val: any) => val && val[TestRunResultFlag]; | ||
export const print = (val: TestRunResult, serialize: any, indent: any) => { | ||
const out = [ | ||
`===[ STDOUT ]${'='.repeat(67)}`, | ||
sanitizeOutput(val.stdout), | ||
`===[ STDERR ]${'='.repeat(67)}`, | ||
sanitizeOutput(val.stderr), | ||
'='.repeat(80), | ||
] | ||
.map(l => indent(l)) | ||
.join('\n'); | ||
return `jest exit code: ${val.status}\n${out}`; | ||
}; |
Oops, something went wrong.