Skip to content

Commit

Permalink
refactor Repeat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas committed Feb 29, 2024
1 parent 9117c63 commit c79947e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ type-definitions/flow-tests/
!type-definitions/ts-tests/partition.ts
!type-definitions/ts-tests/range.ts
!type-definitions/ts-tests/record.ts
!type-definitions/ts-tests/repeat.ts
3 changes: 2 additions & 1 deletion tstyche.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"**/type-definitions/ts-tests/ordered-set.ts",
"**/type-definitions/ts-tests/partition.ts",
"**/type-definitions/ts-tests/range.ts",
"**/type-definitions/ts-tests/record.ts"
"**/type-definitions/ts-tests/record.ts",
"**/type-definitions/ts-tests/repeat.ts"
]
}
18 changes: 7 additions & 11 deletions type-definitions/ts-tests/repeat.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Repeat } from 'immutable';
import { expect, test } from 'tstyche';
import { Repeat, Seq } from 'immutable';

{
// #constructor
test('#constructor', () => {
expect(Repeat(0, 0)).type.toEqual<Seq.Indexed<number>>();

// $ExpectType Indexed<number>
Repeat(0, 0);
expect(Repeat('a', 0)).type.toEqual<Seq.Indexed<string>>();

// $ExpectType Indexed<string>
Repeat('a', 0);

// $ExpectError
Repeat('a', 'b');
}
expect(Repeat('a', 'b')).type.toRaiseError();
});
3 changes: 2 additions & 1 deletion type-definitions/ts-tests/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"ordered-set.ts",
"partition.ts",
"range.ts",
"record.ts"
"record.ts",
"repeat.ts"
]
},
"rules": {
Expand Down

0 comments on commit c79947e

Please sign in to comment.