-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #526
- Loading branch information
Showing
11 changed files
with
481 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`toEmitValueFirst matcher test negative cases Should fail if no values emitted 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"(a|)"[39m | ||
But got: | ||
[31m""[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- (a|)[39m" | ||
`; | ||
|
||
exports[`toEmitValueFirst matcher test negative cases Should fail if no values emitted and completed 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"---(a|)"[39m | ||
But got: | ||
[31m"---|"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- ---(a|)[39m | ||
[31m+ ---|[39m" | ||
`; | ||
|
||
exports[`toEmitValueFirst matcher test negative cases Should fail if other value emits 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"---(a|)"[39m | ||
But got: | ||
[31m"---(b|)"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- ---(a|)[39m | ||
[31m+ ---(b|)[39m" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`toEmitValueLast matcher test negative cases Should fail if no values emitted 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"(a|)"[39m | ||
But got: | ||
[31m""[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- (a|)[39m" | ||
`; | ||
|
||
exports[`toEmitValueLast matcher test negative cases Should fail if no values emitted and completed 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"---(a|)"[39m | ||
But got: | ||
[31m"---|"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- ---(a|)[39m | ||
[31m+ ---|[39m" | ||
`; | ||
|
||
exports[`toEmitValueLast matcher test negative cases Should fail if observable never completes 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"(b|)"[39m | ||
But got: | ||
[31m""[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- (b|)[39m" | ||
`; | ||
|
||
exports[`toEmitValueLast matcher test negative cases Should fail if other value emits 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"-------(b|)"[39m | ||
But got: | ||
[31m"-------(a|)"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- -------(b|)[39m | ||
[31m+ -------(a|)[39m" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`toEmitValueNth matcher test negative cases Should fail if no values emitted 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"(a|)"[39m | ||
But got: | ||
[31m""[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- (a|)[39m" | ||
`; | ||
|
||
exports[`toEmitValueNth matcher test negative cases Should fail if no values emitted and completed 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"---(a|)"[39m | ||
But got: | ||
[31m"---|"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- ---(a|)[39m | ||
[31m+ ---|[39m" | ||
`; | ||
|
||
exports[`toEmitValueNth matcher test negative cases Should fail if other value emits 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toBeNotifications([22m[32mexpected[39m[2m)[22m | ||
Expected notifications to be: | ||
[32m"--(a|)"[39m | ||
But got: | ||
[31m"--(b|)"[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[32m- --(a|)[39m | ||
[31m+ --(b|)[39m" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { cold, Scheduler } from '../index'; | ||
|
||
describe('toEmitValueFirst matcher test', () => { | ||
describe('positive cases', () => { | ||
it('Should pass if observable completes', () => { | ||
const a$ = cold('a-|'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
it('Should pass if observable not completes', () => { | ||
const a$ = cold('a---'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
it('Should pass if value emits later', () => { | ||
const a$ = cold('---a---'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
it('Should pass if multiple value emits later', () => { | ||
const a$ = cold('---a--b---'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
}); | ||
|
||
describe('negative cases', () => { | ||
it('Should fail if other value emits', () => { | ||
const a$ = cold('---b---'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
it('Should fail if no values emitted', () => { | ||
const a$ = cold('---'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
it('Should fail if no values emitted and completed', () => { | ||
const a$ = cold('---|'); | ||
|
||
expect(a$).toEmitValueFirst('a'); | ||
}); | ||
|
||
afterEach(() => { | ||
expect(() => Scheduler.flush()).toThrowErrorMatchingSnapshot(); | ||
Scheduler.init(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { cold, Scheduler } from '../index'; | ||
|
||
describe('toEmitValueLast matcher test', () => { | ||
describe('positive cases', () => { | ||
it('Should pass if observable completes', () => { | ||
const a$ = cold('b-|'); | ||
|
||
expect(a$).toEmitValueLast('b'); | ||
}); | ||
|
||
it('Should pass if value emits later', () => { | ||
const a$ = cold('---b---|'); | ||
|
||
expect(a$).toEmitValueLast('b'); | ||
}); | ||
|
||
it('Should pass if multiple value emits later', () => { | ||
const a$ = cold('---a--b---|'); | ||
|
||
expect(a$).toEmitValueLast('b'); | ||
}); | ||
}); | ||
|
||
describe('negative cases', () => { | ||
it('Should fail if other value emits', () => { | ||
const a$ = cold('---a---|'); | ||
|
||
expect(a$).toEmitValueLast('b'); | ||
}); | ||
|
||
it('Should fail if observable never completes', () => { | ||
const a$ = cold('---b---'); | ||
|
||
expect(a$).toEmitValueLast('b'); | ||
}); | ||
|
||
it('Should fail if no values emitted', () => { | ||
const a$ = cold('---'); | ||
|
||
expect(a$).toEmitValueLast('a'); | ||
}); | ||
|
||
it('Should fail if no values emitted and completed', () => { | ||
const a$ = cold('---|'); | ||
|
||
expect(a$).toEmitValueLast('a'); | ||
}); | ||
|
||
afterEach(() => { | ||
expect(() => Scheduler.flush()).toThrowErrorMatchingSnapshot(); | ||
Scheduler.init(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.