@@ -6,36 +6,49 @@ import {EVENT} from '../src/internal/Events'
6
6
import { createTestScheduler } from '../src/schedulers/TestScheduler'
7
7
8
8
describe ( 'new TestScheduler()' , ( ) => {
9
- it ( 'should just ... ', ( ) => {
10
- const sh = createTestScheduler ( )
11
- assert . strictEqual ( sh . now ( ) , 0 )
9
+ describe ( 'now() ', ( ) => {
10
+ it ( 'should return current time' , ( ) => {
11
+ const sh = createTestScheduler ( )
12
12
13
- sh . advanceBy ( 10 )
14
- assert . strictEqual ( sh . now ( ) , 10 )
13
+ assert . strictEqual ( sh . now ( ) , 0 )
15
14
16
- sh . advanceBy ( 2 )
17
- assert . strictEqual ( sh . now ( ) , 12 )
15
+ sh . advanceBy ( 10 )
16
+ assert . strictEqual ( sh . now ( ) , 10 )
18
17
19
- sh . advanceTo ( 20 )
20
- assert . strictEqual ( sh . now ( ) , 20 )
18
+ sh . advanceBy ( 2 )
19
+ assert . strictEqual ( sh . now ( ) , 12 )
20
+
21
+ sh . advanceTo ( 20 )
22
+ assert . strictEqual ( sh . now ( ) , 20 )
23
+ } )
21
24
} )
22
25
23
- it ( 'should just ... ' , ( ) => {
24
- const sh = createTestScheduler ( )
25
- const { results} = sh . start ( ( ) =>
26
- sh . Hot ( [
26
+ describe ( 'start()' , ( ) => {
27
+ it ( 'should return TestObserver' , ( ) => {
28
+ const sh = createTestScheduler ( )
29
+ const { results} = sh . start ( ( ) =>
30
+ sh . Hot ( [
31
+ EVENT . next ( 210 , '0' ) ,
32
+ EVENT . next ( 220 , '1' ) ,
33
+ EVENT . next ( 230 , '2' ) ,
34
+ EVENT . complete ( 240 )
35
+ ] )
36
+ )
37
+
38
+ assert . deepEqual ( results , [
27
39
EVENT . next ( 210 , '0' ) ,
28
40
EVENT . next ( 220 , '1' ) ,
29
41
EVENT . next ( 230 , '2' ) ,
30
42
EVENT . complete ( 240 )
31
43
] )
32
- )
33
-
34
- assert . deepEqual ( results , [
35
- EVENT . next ( 210 , '0' ) ,
36
- EVENT . next ( 220 , '1' ) ,
37
- EVENT . next ( 230 , '2' ) ,
38
- EVENT . complete ( 240 )
39
- ] )
44
+ } )
45
+ } )
46
+
47
+ describe ( 'Hot()' , ( ) => {
48
+ it ( 'should create events ' , ( ) => {
49
+ const sh = createTestScheduler ( )
50
+ const { results} = sh . start ( ( ) => sh . Hot ( EVENT . next ( 210 , '0' ) ) )
51
+ assert . deepEqual ( results , [ EVENT . next ( 210 , '0' ) ] )
52
+ } )
40
53
} )
41
54
} )
0 commit comments