-
Notifications
You must be signed in to change notification settings - Fork 87
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
4 changed files
with
58 additions
and
2 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,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should handle indexers 1`] = ` | ||
"declare type Map = { | ||
[key: string]: number, | ||
}; | ||
" | ||
`; | ||
|
||
exports[`should handle indexers 2`] = ` | ||
"declare type Map = { | ||
[key: string]: number, | ||
}; | ||
" | ||
`; |
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,24 @@ | ||
import { compiler, beautify } from ".."; | ||
import "../test-matchers"; | ||
|
||
it("should handle indexers", () => { | ||
const ts = ` | ||
type Map = { | ||
[key: string]: number | ||
} | ||
`; | ||
{ | ||
const result = compiler.compileDefinitionString(ts, { quiet: true }); | ||
expect(beautify(result)).toMatchSnapshot(); | ||
expect(result).toBeValidFlowTypeDeclarations(); | ||
} | ||
|
||
{ | ||
const result = compiler.compileDefinitionString(ts, { | ||
quiet: true, | ||
inexact: false, | ||
}); | ||
expect(beautify(result)).toMatchSnapshot(); | ||
expect(result).toBeValidFlowTypeDeclarations(); | ||
} | ||
}); |
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