Skip to content

Commit 964c15b

Browse files
committed
test(enums): [ErrorCode] update type test strategy
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent b3ca4a7 commit 964c15b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/enums/__tests__/error-code.spec-d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ import type TestSubject from '../error-code'
77

88
describe('unit-d:enums/ErrorCode', () => {
99
it('should have members of type Uppercase<string>', () => {
10-
expectTypeOf<typeof TestSubject>()
11-
.extract<Uppercase<string>>()
12-
.not.toBeNever()
10+
// Arrange
11+
type Key = keyof typeof TestSubject
12+
13+
// Expect
14+
expectTypeOf<Key>().toMatchTypeOf<Uppercase<string>>()
15+
expectTypeOf<TestSubject>().toMatchTypeOf<Key>()
16+
expectTypeOf<typeof TestSubject[Key]>().toEqualTypeOf<TestSubject>()
1317
})
1418
})

0 commit comments

Comments
 (0)