@@ -7,7 +7,7 @@ describe('TestScheduler', function() {
7
7
it ( 'should exist' , function ( ) {
8
8
expect ( typeof TestScheduler ) . toBe ( 'function' ) ;
9
9
} ) ;
10
-
10
+
11
11
describe ( 'parseMarbles()' , function ( ) {
12
12
it ( 'should parse a marble string into a series of notifications and types' , function ( ) {
13
13
var result = TestScheduler . parseMarbles ( '-------a---b---|' , { a : 'A' , b : 'B' } ) ;
@@ -17,7 +17,7 @@ describe('TestScheduler', function() {
17
17
{ frame : 150 , notification : Notification . createComplete ( ) }
18
18
] ) ;
19
19
} ) ;
20
-
20
+
21
21
it ( 'should parse a marble string with a subscription point' , function ( ) {
22
22
var result = TestScheduler . parseMarbles ( '---^---a---b---|' , { a : 'A' , b : 'B' } ) ;
23
23
expect ( result ) . toDeepEqual ( [
@@ -26,7 +26,7 @@ describe('TestScheduler', function() {
26
26
{ frame : 120 , notification : Notification . createComplete ( ) }
27
27
] ) ;
28
28
} ) ;
29
-
29
+
30
30
it ( 'should parse a marble string with an error' , function ( ) {
31
31
var result = TestScheduler . parseMarbles ( '-------a---b---#' , { a : 'A' , b : 'B' } , 'omg error!' ) ;
32
32
expect ( result ) . toDeepEqual ( [
@@ -35,7 +35,7 @@ describe('TestScheduler', function() {
35
35
{ frame : 150 , notification : Notification . createError ( 'omg error!' ) }
36
36
] ) ;
37
37
} ) ;
38
-
38
+
39
39
it ( 'should default in the letter for the value if no value hash was passed' , function ( ) {
40
40
var result = TestScheduler . parseMarbles ( '--a--b--c--' ) ;
41
41
expect ( result ) . toDeepEqual ( [
@@ -44,7 +44,7 @@ describe('TestScheduler', function() {
44
44
{ frame : 80 , notification : Notification . createNext ( 'c' ) } ,
45
45
] )
46
46
} ) ;
47
-
47
+
48
48
it ( 'should handle grouped values' , function ( ) {
49
49
var result = TestScheduler . parseMarbles ( '---(abc)---' ) ;
50
50
expect ( result ) . toDeepEqual ( [
@@ -53,9 +53,9 @@ describe('TestScheduler', function() {
53
53
{ frame : 30 , notification : Notification . createNext ( 'c' ) }
54
54
] ) ;
55
55
} ) ;
56
-
57
- } ) ;
58
-
56
+
57
+ } ) ;
58
+
59
59
describe ( 'createColdObservable()' , function ( ) {
60
60
it ( 'should create a cold observable' , function ( ) {
61
61
var expected = [ 'A' , 'B' ] ;
@@ -69,7 +69,7 @@ describe('TestScheduler', function() {
69
69
expect ( expected . length ) . toBe ( 0 ) ;
70
70
} ) ;
71
71
} ) ;
72
-
72
+
73
73
describe ( 'createHotObservable()' , function ( ) {
74
74
it ( 'should create a cold observable' , function ( ) {
75
75
var expected = [ 'A' , 'B' ] ;
@@ -83,19 +83,19 @@ describe('TestScheduler', function() {
83
83
expect ( expected . length ) . toBe ( 0 ) ;
84
84
} ) ;
85
85
} ) ;
86
-
86
+
87
87
describe ( 'jasmine helpers' , function ( ) {
88
88
describe ( 'rxTestScheduler' , function ( ) {
89
89
it ( 'should exist' , function ( ) {
90
90
expect ( rxTestScheduler instanceof Rx . TestScheduler ) . toBe ( true ) ;
91
91
} ) ;
92
92
} ) ;
93
-
93
+
94
94
describe ( 'cold()' , function ( ) {
95
95
it ( 'should exist' , function ( ) {
96
96
expect ( typeof cold ) . toBe ( 'function' ) ;
97
97
} ) ;
98
-
98
+
99
99
it ( 'should create a cold observable' , function ( ) {
100
100
var expected = [ 1 , 2 ] ;
101
101
var source = cold ( '-a-b-|' , { a : 1 , b : 2 } ) ;
@@ -107,43 +107,50 @@ describe('TestScheduler', function() {
107
107
expectObservable ( source ) . toBe ( '-a-b-|' , { a : 1 , b : 2 } ) ;
108
108
} ) ;
109
109
} ) ;
110
-
110
+
111
111
describe ( 'hot()' , function ( ) {
112
112
it ( 'should exist' , function ( ) {
113
113
expect ( typeof hot ) . toBe ( 'function' ) ;
114
114
} ) ;
115
-
115
+
116
116
it ( 'should create a hot observable' , function ( ) {
117
117
var source = hot ( '---^-a-b-|' , { a : 1 , b : 2 } ) ;
118
118
expect ( source instanceof Rx . Subject ) . toBe ( true ) ;
119
119
expectObservable ( source ) . toBe ( '--a-b-|' , { a : 1 , b : 2 } ) ;
120
120
} ) ;
121
121
} ) ;
122
-
122
+
123
123
describe ( 'expectObservable()' , function ( ) {
124
124
it ( 'should exist' , function ( ) {
125
125
expect ( typeof expectObservable ) . toBe ( 'function' ) ;
126
126
} ) ;
127
-
127
+
128
128
it ( 'should return an object with a toBe function' , function ( ) {
129
129
expect ( typeof ( expectObservable ( Rx . Observable . of ( 1 ) ) . toBe ) ) . toBe ( 'function' ) ;
130
130
} ) ;
131
-
131
+
132
132
it ( 'should append to flushTests array' , function ( ) {
133
133
expectObservable ( Rx . Observable . empty ( ) ) ;
134
134
expect ( rxTestScheduler . flushTests . length ) . toBe ( 1 ) ;
135
135
} ) ;
136
-
136
+
137
137
it ( 'should handle empty' , function ( ) {
138
138
expectObservable ( Rx . Observable . empty ( ) ) . toBe ( '|' , { } ) ;
139
139
} ) ;
140
-
140
+
141
141
it ( 'should handle never' , function ( ) {
142
142
expectObservable ( Rx . Observable . never ( ) ) . toBe ( '-' , { } ) ;
143
143
expectObservable ( Rx . Observable . never ( ) ) . toBe ( '---' , { } ) ;
144
144
} ) ;
145
+
146
+ it ( 'should accept an unsubscription marble diagram' , function ( ) {
147
+ var source = hot ( '---^-a-b-|' ) ;
148
+ var unsubscribe = '---!' ;
149
+ var expected = '--a' ;
150
+ expectObservable ( source , unsubscribe ) . toBe ( expected ) ;
151
+ } ) ;
145
152
} ) ;
146
-
153
+
147
154
describe ( 'end-to-end helper tests' , function ( ) {
148
155
it ( 'should be awesome' , function ( ) {
149
156
var values = { a : 1 , b : 2 } ;
@@ -152,4 +159,4 @@ describe('TestScheduler', function() {
152
159
} ) ;
153
160
} ) ;
154
161
} ) ;
155
- } ) ;
162
+ } ) ;
0 commit comments