10000 make the tests more like the others · SebastienGllmt/typescript-is@a44dd46 · GitHub
[go: up one dir, main page]

Skip to content

Commit a44dd46

Browse files
committed
make the tests more like the others
1 parent f73e649 commit a44dd46

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/issue-91.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ import * as assert from 'assert';
44
describe('template literal types', () => {
55
describe('union types', () => {
66
type Foo = `foo${'bar' | 'baz'}`
7-
it('true', () => assert(is<Foo>('foobar')))
8-
it('false', () => assert(!is<Foo>('barbaz')))
7+
it('true', () => assert.deepStrictEqual(is<Foo>('foobar'), true))
8+
it('false', () => assert.deepStrictEqual(is<Foo>('barbaz'), false))
99
})
1010

1111
describe('primitives', () => {
1212
type Foo = `foo${string}bar${number}`
13-
it('true', () => assert(is<Foo>('foobazbar123')))
14-
it('false', () => assert(!is<Foo>('foobazbar123qux'))) // TODO: figure out why this one causes a stack overflow when using assertType
13+
it('true', () => assert.deepStrictEqual(is<Foo>('foobazbar123'), true))
14+
it('false', () => assert.deepStrictEqual(is<Foo>('foobazbar123qux'), false))
1515
})
1616

17-
it('buncha stuff', () =>
18-
assert(is<`foo${string}${number}bar${1 | 2 | 3}baz${number}asdf`>('foobar1bar2baz123asdf'))
17+
it('unions and primitives', () =>
18+
assert.deepStrictEqual(
19+
is<`foo${string}${number}bar${1 | 2 | 3}baz${number}asdf`>('foobar1bar2baz123asdf'), true
20+
)
1921
)
2022
})

0 commit comments

Comments
 (0)
0