我正在尝试使用jasmine-marbles做一个简单的测试,但是得到了错误
这是我的测试代码:
describe('MarbleTestingComponent', () => {
it('should test marble syntax', () => {
const provided = search('e');
const expected = cold('(e|)', {e: 'e'});
console.log(expected, provided);
expect(provided).toBeObservable(expected);
})
});这就是我得到的错误:
Error:
Expected: (e|),
Received: (?|),
Expected:
[{"frame":0,"notification":{"kind":"N","value":"e","hasValue":true}},{"frame":0,"notification":{"kind":"C","hasValue":false}}]
Received:
[{"frame":0,"notification":{"kind":"N","value":"e"}},{"frame":0,"notification":{"kind":"C"}}],如果我使用jest框架,上面的代码可以工作,但我想让它与Angular安装程序附带的默认测试框架一起工作
感谢您对此错误排序的任何帮助
发布于 2021-07-02 23:08:19
试着检查一下jasmine-marble版本。
我在使用“jasmine-marble”时遇到了同样的问题:"^0.9.0“与"rxjs":"^6.6.7”。
降级到“jasmine-marble”:"^0.8.0“解决了这个问题。
请在此处查看支持的版本:https://github.com/synapse-wireless-labs/jasmine-marbles#readme
发布于 2021-09-13 20:52:49
我不知道是否可以帮助你,但我有同样的问题,测试效果,我修复了它使用https://ngrx.io/guide/effects/testing#with-testscheduler。我认为jasmine-marble的最新版本没有与rxjs对齐。
希望能对你有所帮助。
https://stackoverflow.com/questions/68222027
复制相似问题