-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolution.spec.ts
47 lines (40 loc) · 999 Bytes
/
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
40
41
42
43
44
45
46
47
import type { Equal, Expect } from 'type-testing'
import type { PresentDeliveryList } from './solution'
type Address = {
address: string
city: string
}
describe('Challenge 04: replace the values of each attributes of an object with an address', () => {
it('Test 01', () => {
type MixedBehaviorList = {
john: { behavior: 'good' }
jimmy: { behavior: 'bad' }
sara: { behavior: 'good' }
suzy: { behavior: 'good' }
chris: { behavior: 'good' }
penny: { behavior: 'bad' }
}
type Actual = PresentDeliveryList<MixedBehaviorList>
type Expected = {
john: Address
jimmy: Address
sara: Address
suzy: Address
chris: Address
penny: Address
}
type Test = Expect<Equal<Actual, Expected>>
})
it('Test 02', () => {
type Unrelated = {
hello: { hello: 'hello' }
world: { world: 'world' }
}
type Actual = PresentDeliveryList<Unrelated>
type Expected = {
hello: Address
world: Address
}
type Test = Expect<Equal<Actual, Expected>>
})
})