-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from danvk/pr-13-update
Use tsconfig.json, clearer errors for unattached nodes
- Loading branch information
Showing
12 changed files
with
356 additions
and
72 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 |
---|---|---|
|
@@ -40,5 +40,5 @@ jspm_packages | |
.vscode/ | ||
|
||
# Generated JS files | ||
src/*.js | ||
src/*.js.map | ||
dist/ | ||
|
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
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,62 @@ | ||
import * as ts from 'typescript'; | ||
|
||
export interface LineNumber { | ||
line: number; // 0-based | ||
} | ||
|
||
export interface IAssertion extends LineNumber { | ||
kind: string; | ||
} | ||
|
||
export interface TypeAssertion extends IAssertion { | ||
kind: 'type'; | ||
type: string; | ||
} | ||
|
||
export interface ErrorAssertion extends IAssertion { | ||
kind: 'error'; | ||
pattern: string; | ||
} | ||
|
||
export type Assertion = TypeAssertion | ErrorAssertion; | ||
|
||
export interface NodedAssertion { | ||
assertion: Assertion; | ||
node: ts.Node; | ||
type: ts.Type; | ||
error?: ts.Diagnostic; | ||
} | ||
|
||
export interface IFailure extends LineNumber { | ||
code?: string; | ||
type: string; | ||
} | ||
|
||
export interface WrongTypeFailure extends IFailure { | ||
type: 'WRONG_TYPE'; | ||
expectedType: string; | ||
actualType: string; | ||
} | ||
|
||
export interface UnexpectedErrorFailure extends IFailure { | ||
type: 'UNEXPECTED_ERROR'; | ||
message: string; | ||
} | ||
|
||
export interface WrongErrorFailure extends IFailure { | ||
type: 'WRONG_ERROR'; | ||
expectedMessage: string; | ||
actualMessage: string; | ||
} | ||
|
||
export interface MissingErrorFailure extends IFailure { | ||
type: 'MISSING_ERROR'; | ||
message: string; | ||
} | ||
|
||
export type Failure = WrongTypeFailure | UnexpectedErrorFailure | WrongErrorFailure | MissingErrorFailure; | ||
|
||
export interface Report { | ||
numSuccesses: number; | ||
failures: Failure[]; | ||
} |
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 @@ | ||
could not load content of doesnt_exist.ts |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"noImplicitAny": false, | ||
"sourceMap": false | ||
} | ||
} |
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
Oops, something went wrong.