I am trying to create a simple test with RxJS marbles.
I am using mocha and chai.
I am instantiating a new test scheduler and I do not want to use the "testScheduler.createHotObservable method" because I want to use my own Observable, the "Observable.of(4)"
const testScheduler = new TestScheduler(assert.deepEqual.bind(assert));
const expected = "a";
const expectedStateMap = {
a: 4
};
testScheduler.expectObservable(Observable.of(4)).toBe(expected, expectedStateMap);
testScheduler.flush();
This is the error:
AssertionError: expected [ Array(2) ] to deeply equal [ Array(1) ]
+ expected - actual
"notification": {
"error": [undefined]
"hasValue": true
"kind": "N"
- "value": 4
+ "value": "4"
}
}
- {
- "frame": 0
- "notification": {
- "error": [undefined]
- "hasValue": false
- "kind": "C"
- "value": [undefined]
- }
- }
]
at TestScheduler.flush (node_modules/rxjs/src/testing/TestScheduler.ts:135:12)
Any ideas what is wrong?