-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3c1381d
commit f6317d3
Showing
6 changed files
with
79 additions
and
24 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,5 @@ | ||
export { ArrayType } from "./ArrayType" | ||
export { ArrayTypeDeclaration } from "./ArrayTypeDeclaration" | ||
export { BooleanType } from "./BooleanType" | ||
export { EnumType } from "./EnumType" | ||
export { EnumTypeDeclaration } from "./EnumTypeDeclaration" |
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,21 @@ | ||
import test from "ava" | ||
import { resolve } from "path" | ||
import { UnresolvedImportError } from "../src/models/Import" | ||
import { UnknownType } from "../src/models/UnknownType" | ||
import { Parser } from "../src/parser" | ||
|
||
test("breakOnUnresolvedImports: true", (t) => { | ||
const parser = new Parser(resolve(__dirname, "fixtures", "configurationTestTypes.ts"), { breakOnUnresolvedImports: true }) | ||
t.throws( | ||
() => { | ||
parser.resolve("UnresolvedImport") | ||
}, | ||
{ instanceOf: UnresolvedImportError } | ||
) | ||
}) | ||
|
||
test("breakOnUnresolvedImports: false, should resolve to unknown", (t) => { | ||
const parser = new Parser(resolve(__dirname, "fixtures", "configurationTestTypes.ts"), { breakOnUnresolvedImports: false }) | ||
const declaration = parser.resolve("UnresolvedImport") | ||
t.assert(declaration.type instanceof UnknownType) | ||
}) |
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,3 @@ | ||
import { UnResolved } from "does-not-exist" | ||
|
||
type UnresolvedImport = UnResolved |
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