Skip to content

Commit 41ec5f6

Browse files
committed
Merge pull request #2034 from mrazauskas/upgrade-tstyche
2 parents 69da530 + 0af832a commit 41ec5f6

File tree

11 files changed

+30
-45
lines changed

11 files changed

+30
-45
lines changed

package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"rollup": "3.28.1",
128128
"size-limit": "^8.2.6",
129129
"transducers-js": "0.4.174",
130-
"tstyche": "^2.1.1",
130+
"tstyche": "^3.0.0-rc.2",
131131
"typescript": "5.1"
132132
},
133133
"size-limit": [

tstyche.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://tstyche.org/schemas/config.json",
33
"testFileMatch": [
4-
"**/type-definitions/ts-tests/*.ts"
4+
"type-definitions/ts-tests/*.ts"
55
]
66
}

type-definitions/ts-tests/list.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import {
33
List,
44
get,
@@ -21,9 +21,7 @@ test('#constructor', () => {
2121
});
2222

2323
test('#size', () => {
24-
expect(List().size).type.toBeNumber();
25-
26-
expect(List()).type.toMatch<{ readonly size: number }>();
24+
expect(pick(List(), 'size')).type.toBe<{ readonly size: number }>();
2725
});
2826

2927
test('#setSize', () => {

type-definitions/ts-tests/map.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { Map, List, MapOf, OrderedMap } from 'immutable';
33

44
test('#constructor', () => {
@@ -45,9 +45,7 @@ test('#constructor', () => {
4545
});
4646

4747
test('#size', () => {
48-
expect(Map().size).type.toBeNumber();
49-
50-
expect(Map()).type.toMatch<{ readonly size: number }>();
48+
expect(pick(Map(), 'size')).type.toBe<{ readonly size: number }>();
5149
});
5250

5351
test('#get', () => {

type-definitions/ts-tests/ordered-map.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { OrderedMap, List } from 'immutable';
33

44
test('#constructor', () => {
@@ -20,9 +20,7 @@ test('#constructor', () => {
2020
});
2121

2222
test('#size', () => {
23-
expect(OrderedMap().size).type.toBeNumber();
24-
25-
expect(OrderedMap()).type.toMatch<{ readonly size: number }>();
23+
expect(pick(OrderedMap(), 'size')).type.toBe<{ readonly size: number }>();
2624
});
2725

2826
test('#get', () => {

type-definitions/ts-tests/ordered-set.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { Collection, OrderedSet, Map } from 'immutable';
33

44
test('#constructor', () => {
@@ -12,9 +12,7 @@ test('#constructor', () => {
1212
});
1313

1414
test('#size', () => {
15-
expect(OrderedSet().size).type.toBeNumber();
16-
17-
expect(OrderedSet()).type.toMatch<{ readonly size: number }>();
15+
expect(pick(OrderedSet(), 'size')).type.toBe<{ readonly size: number }>();
1816
});
1917

2018
test('.of', () => {

type-definitions/ts-tests/record.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { List, Map, MapOf, Record, RecordOf, Set } from 'immutable';
33

44
test('Factory', () => {
@@ -14,13 +14,9 @@ test('Factory', () => {
1414
Record<{ x: number; y: number }> & Readonly<{ x: number; y: number }>
1515
>();
1616

17-
expect(pointXY.x).type.toBeNumber();
17+
expect(pick(pointXY, 'x')).type.toBe<{ readonly x: number }>();
1818

19-
expect(pointXY).type.toMatch<{ readonly x: number }>();
20-
21-
expect(pointXY.y).type.toBeNumber();
22-
23-
expect(pointXY).type.toMatch<{ readonly y: number }>();
19+
expect(pick(pointXY, 'y')).type.toBe<{ readonly y: number }>();
2420

2521
expect(pointXY.toJS()).type.toBe<{ x: number; y: number }>();
2622

type-definitions/ts-tests/seq.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { Seq } from 'immutable';
33

44
test('#constructor', () => {
55
expect(Seq([1, 2, 3])).type.toBe<Seq.Indexed<number>>();
66
});
77

88
test('#size', () => {
9-
expect(Seq().size).type.toBe<number | undefined>();
10-
11-
expect(Seq()).type.toMatch<{ readonly size: number | undefined }>();
9+
expect(pick(Seq(), 'size')).type.toBe<{
10+
readonly size: number | undefined;
11+
}>();
1212
});

type-definitions/ts-tests/set.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from 'tstyche';
1+
import { expect, pick, test } from 'tstyche';
22
import { Set, Map, Collection, OrderedSet } from 'immutable';
33

44
test('#constructor', () => {
@@ -12,9 +12,7 @@ test('#constructor', () => {
1212
});
1313

1414
test('#size', () => {
15-
expect(Set().size).type.toBeNumber();
16-
17-
expect(Set()).type.toMatch<{ readonly size: number }>();
15+
expect(pick(Set(), 'size')).type.toBe<{ readonly size: number }>();
1816
});
1917

2018
test('.of', () => {

0 commit comments

Comments
 (0)