-
Notifications
You must be signed in to change notification settings - Fork 74
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
13 changed files
with
817 additions
and
544 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,42 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Typescript 4.4 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 2`] = ` | ||
"48:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. | ||
Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." | ||
`; | ||
|
||
exports[`Typescript 4.4 detects errors 3`] = `"52:11 - Type 'number' is not assignable to type 'string'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 4`] = `"53:10 - Type 'number' is not assignable to type 'string'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 5`] = ` | ||
"58:6 - Type '{}' is not assignable to type 'string & {}'. | ||
Type '{}' is not assignable to type 'string'." | ||
`; | ||
|
||
exports[`Typescript 4.4 detects errors 6`] = ` | ||
"63:10 - Type '\\"auto\\" | (string & {})' is not assignable to type '\\"auto\\"'. | ||
Type 'string & {}' is not assignable to type '\\"auto\\"'." | ||
`; | ||
|
||
exports[`Typescript 4.4 detects errors 7`] = `"70:6 - Type '1' is not assignable to type 'string | 0'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 8`] = `"82:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; | ||
|
||
exports[`Typescript 4.4 detects errors 9`] = `"96:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; | ||
|
||
exports[`Typescript 4.4 detects errors 10`] = `"106:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 11`] = `"107:15 - Type '1' is not assignable to type 'string | 0'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 12`] = `"120:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; | ||
|
||
exports[`Typescript 4.4 detects errors 13`] = `"134:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; | ||
|
||
exports[`Typescript 4.4 detects errors 14`] = `"144:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 15`] = `"145:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; | ||
|
||
exports[`Typescript 4.4 detects errors 16`] = `"150:38 - Namespace '\\"index\\"' has no exported member 'DataType'."`; |
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,22 @@ | ||
import * as path from 'path'; | ||
import * as ts from 'typescript4.4'; | ||
import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; | ||
|
||
describe('Typescript 4.4', () => { | ||
it('detects errors', async () => { | ||
const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); | ||
const diagnostics = ts.getPreEmitDiagnostics(program); | ||
const errors = diagnostics.map(diagnostic => { | ||
const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); | ||
return `${line}:${character} - ${removeAbsolutePaths( | ||
ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), | ||
)}`; | ||
}); | ||
|
||
expect(Number(ts.versionMajorMinor)).toBe(4.4); | ||
expect(errors.length).toBe(16); | ||
for (const error of errors) { | ||
expect(error).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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.