-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
395ad40
commit 0a5d06e
Showing
4 changed files
with
31 additions
and
42 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,57 +1,44 @@ | ||
import { expect, test } from 'tstyche'; | ||
import { Seq, Collection } from 'immutable'; | ||
|
||
{ | ||
// Typed empty seqs | ||
test('typed empty Seq', () => { | ||
expect(Seq()).type.toEqual<Seq<unknown, unknown>>(); | ||
|
||
// $ExpectType Seq<unknown, unknown> | ||
Seq(); | ||
expect(Seq<number, string>()).type.toEqual<Seq<number, string>>(); | ||
|
||
// $ExpectType Seq<number, string> | ||
Seq<number, string>(); | ||
expect(Seq.Indexed()).type.toEqual<Seq.Indexed<unknown>>(); | ||
|
||
// $ExpectType Indexed<unknown> | ||
Seq.Indexed(); | ||
expect(Seq.Indexed<string>()).type.toEqual<Seq.Indexed<string>>(); | ||
|
||
// $ExpectType Indexed<string> | ||
Seq.Indexed<string>(); | ||
expect(Seq.Keyed()).type.toEqual<Seq.Keyed<unknown, unknown>>(); | ||
|
||
// $ExpectType Keyed<unknown, unknown> | ||
Seq.Keyed(); | ||
expect(Seq.Keyed<number, string>()).type.toEqual<Seq.Keyed<number, string>>(); | ||
|
||
// $ExpectType Keyed<number, string> | ||
Seq.Keyed<number, string>(); | ||
expect(Seq.Set()).type.toEqual<Seq.Set<unknown>>(); | ||
|
||
// $ExpectType Set<unknown> | ||
Seq.Set(); | ||
expect(Seq.Set<string>()).type.toEqual<Seq.Set<string>>(); | ||
}); | ||
|
||
// $ExpectType Set<string> | ||
Seq.Set<string>(); | ||
} | ||
test('typed empty Collection', () => { | ||
expect(Collection()).type.toEqual<Collection<unknown, unknown>>(); | ||
|
||
{ | ||
// Typed empty collection | ||
expect(Collection<number, string>()).type.toEqual< | ||
Collection<number, string> | ||
>(); | ||
|
||
// $ExpectType Collection<unknown, unknown> | ||
Collection(); | ||
expect(Collection.Indexed()).type.toEqual<Collection.Indexed<unknown>>(); | ||
|
||
// $ExpectType Collection<number, string> | ||
Collection<number, string>(); | ||
expect(Collection.Indexed<string>()).type.toEqual< | ||
Collection.Indexed<string> | ||
>(); | ||
|
||
// $ExpectType Indexed<unknown> | ||
Collection.Indexed(); | ||
expect(Collection.Keyed()).type.toEqual<Collection.Keyed<unknown, unknown>>(); | ||
|
||
// $ExpectType Indexed<string> | ||
Collection.Indexed<string>(); | ||
expect(Collection.Keyed<number, string>()).type.toEqual< | ||
Collection.Keyed<number, string> | ||
>(); | ||
|
||
// $ExpectType Keyed<unknown, unknown> | ||
Collection.Keyed(); | ||
expect(Collection.Set()).type.toEqual<Collection.Set<unknown>>(); | ||
|
||
// $ExpectType Keyed<number, string> | ||
Collection.Keyed<number, string>(); | ||
|
||
// $ExpectType Set<unknown> | ||
Collection.Set(); | ||
|
||
// $ExpectType Set<string> | ||
Collection.Set<string>(); | ||
} | ||
expect(Collection.Set<string>()).type.toEqual<Collection.Set<string>>(); | ||
}); |
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