-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid returning
failureMessages: [undefined]
(#76)
- Loading branch information
1 parent
60bc054
commit 05f8f8f
Showing
6 changed files
with
140 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
module.exports = { | ||
projects: [ | ||
{ | ||
displayName: 'e2e', | ||
testMatch: ['<rootDir>/e2e/*.test.ts'], | ||
}, | ||
], | ||
reporters: ['default', 'github-actions'], | ||
testMatch: ['<rootDir>/**/__tests__/*.test.ts', '<rootDir>/e2e/*.test.ts'], | ||
testTimeout: 30000, | ||
}; |
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,55 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`fails 1`] = ` | ||
Object { | ||
"console": null, | ||
"failureMessage": " ● tsd typecheck | ||
Argument of type 'number' is not assignable to parameter of type 'string'. | ||
> 5 | expectType<string>(concat(1, 2)); | ||
| ^ | ||
at e2e/__fixtures__/js-failing/index.test.ts:5:1", | ||
"numFailingTests": 1, | ||
"numPassingTests": 3, | ||
"numPendingTests": 0, | ||
"numTodoTests": 0, | ||
"perfStats": Object { | ||
"end": 1200, | ||
"start": 0, | ||
}, | ||
"skipped": undefined, | ||
"snapshot": Object { | ||
"added": 0, | ||
"fileDeleted": false, | ||
"matched": 0, | ||
"unchecked": 0, | ||
"unmatched": 0, | ||
"updated": 0, | ||
}, | ||
"sourceMaps": Object {}, | ||
"testExecError": null, | ||
"testFilePath": "/path/to/e2e/__fixtures__/js-failing/index.test.ts", | ||
"testResults": Array [ | ||
Object { | ||
"ancestorTitles": Array [], | ||
"duration": 1200, | ||
"failureMessages": Array [ | ||
" ● tsd typecheck | ||
Argument of type 'number' is not assignable to parameter of type 'string'. | ||
> 5 | expectType<string>(concat(1, 2)); | ||
| ^ | ||
at e2e/__fixtures__/js-failing/index.test.ts:5:1", | ||
], | ||
"fullName": undefined, | ||
"numPassingAsserts": 1, | ||
"status": "failed", | ||
"title": "tsd typecheck", | ||
}, | ||
], | ||
} | ||
`; |
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,39 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`pass 1`] = ` | ||
Object { | ||
"console": null, | ||
"failureMessage": undefined, | ||
"numFailingTests": 0, | ||
"numPassingTests": 5, | ||
"numPendingTests": 0, | ||
"numTodoTests": 0, | ||
"perfStats": Object { | ||
"end": 1200, | ||
"start": 0, | ||
}, | ||
"skipped": undefined, | ||
"snapshot": Object { | ||
"added": 0, | ||
"fileDeleted": false, | ||
"matched": 0, | ||
"unchecked": 0, | ||
"unmatched": 0, | ||
"updated": 0, | ||
}, | ||
"sourceMaps": Object {}, | ||
"testExecError": null, | ||
"testFilePath": "/path/to/e2e/__fixtures__/js-passing/index.test.ts", | ||
"testResults": Array [ | ||
Object { | ||
"ancestorTitles": Array [], | ||
"duration": 1200, | ||
"failureMessages": Array [], | ||
"fullName": undefined, | ||
"numPassingAsserts": 0, | ||
"status": "passed", | ||
"title": "tsd typecheck", | ||
}, | ||
], | ||
} | ||
`; |
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,27 @@ | ||
import { expect, test } from '@jest/globals'; | ||
import { fail } from '../fail'; | ||
|
||
const errorMessage = ` ● tsd typecheck | ||
Argument of type 'number' is not assignable to parameter of type 'string'. | ||
> 5 | expectType<string>(concat(1, 2)); | ||
| ^ | ||
at e2e/__fixtures__/js-failing/index.test.ts:5:1`; | ||
|
||
test('fails', () => { | ||
const testResult = fail({ | ||
start: 0, | ||
end: 1200, | ||
test: { | ||
path: '/path/to/e2e/__fixtures__/js-failing/index.test.ts', | ||
title: 'tsd typecheck', | ||
}, | ||
errorMessage, | ||
numFailed: 1, | ||
numPassed: 3, | ||
}); | ||
|
||
expect(testResult).toMatchSnapshot(); | ||
}); |
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,16 @@ | ||
import { expect, test } from '@jest/globals'; | ||
import { pass } from '../pass'; | ||
|
||
test('pass', () => { | ||
const testResult = pass({ | ||
start: 0, | ||
end: 1200, | ||
test: { | ||
path: '/path/to/e2e/__fixtures__/js-passing/index.test.ts', | ||
title: 'tsd typecheck', | ||
}, | ||
numPassed: 5, | ||
}); | ||
|
||
expect(testResult).toMatchSnapshot(); | ||
}); |
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