-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolution.spec.ts
39 lines (33 loc) · 1.14 KB
/
solution.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import type { Equal, Expect } from 'type-testing'
import type { SantasList } from './solution'
describe('Challenge 05: create an array with the values of two arrays combined', () => {
it('Test 01', () => {
type Actual = SantasList<['tommy', 'trash'], ['bash', 'tru']>
type Expected = ['tommy', 'trash', 'bash', 'tru']
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 02', () => {
type Actual = SantasList<[], []>
type Expected = []
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 03', () => {
type Actual = SantasList<[], ['trash']>
type Expected = ['trash']
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 04', () => {
type Actual = SantasList<['john'], ['ashley', 'elliot', 'ziltoid']>
type Expected = ['john', 'ashley', 'elliot', 'ziltoid']
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 05', () => {
type Actual = SantasList<['1', 2, '3'], [false, boolean, '4', ['nested']]>
type Expected = ['1', 2, '3', false, boolean, '4', ['nested']]
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 06', () => {
// @ts-expect-error
type Actual = SantasList<null, undefined>
})
})