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
0a5d06e
commit 6ce6deb
Showing
4 changed files
with
23 additions
and
16 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
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,18 +1,23 @@ | ||
import { | ||
Map as ImmutableMap, | ||
Set as ImmutableSet, | ||
} from 'immutable'; | ||
import { expect, test } from 'tstyche'; | ||
import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; | ||
|
||
// Immutable.js collections | ||
const mapImmutable: ImmutableMap<string, number> = ImmutableMap<string, number>(); | ||
const setImmutable: ImmutableSet<string> = ImmutableSet<string>(); | ||
test('immutable.js collections', () => { | ||
const mapImmutable: ImmutableMap<string, number> = ImmutableMap< | ||
string, | ||
number | ||
>(); | ||
const setImmutable: ImmutableSet<string> = ImmutableSet<string>(); | ||
|
||
// $ExpectType Map<string, number> | ||
mapImmutable.delete('foo'); | ||
expect(mapImmutable.delete('foo')).type.toEqual< | ||
ImmutableMap<string, number> | ||
>(); | ||
expect(setImmutable.delete('bar')).type.toEqual<ImmutableSet<string>>(); | ||
}); | ||
|
||
// ES6 collections | ||
const mapES6: Map<string, number> = new Map<string, number>(); | ||
const setES6: Set<string> = new Set<string>(); | ||
test('ES6 collections', () => { | ||
const mapES6: Map<string, number> = new Map<string, number>(); | ||
const setES6: Set<string> = new Set<string>(); | ||
|
||
// $ExpectType boolean | ||
mapES6.delete('foo'); | ||
expect(mapES6.delete('foo')).type.toEqual<boolean>(); | ||
expect(setES6.delete('bar')).type.toEqual<boolean>(); | ||
}); |
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