question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jasmine-marbles ~0.3.0 seems not to work with RxJS 6

See original GitHub issue

Tested with version

  • jasmine-marbles 0.3.1 with RxJS
    • 6.0.0-tactical-rc.1
    • 6.0.0-uncanny-rc.7

Code to reproduce:

Expected behavior:

The unit tests should pass.

Actual behavior:

Running karma test runner throws the following error:

HeadlessChrome 65.0.3325 (Windows 10.0.0) (effect) book-collection When a draft is saved successfully encountered a declaration exception FAILED
-        Error: No test scheduler initialized
            at getTestScheduler node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:265:1)
            at new TestHotObservable node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:303:1)
            at Object.hot node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:313:1)
            at Suite.<anonymous> src/app/book/effects/book-collection.effects.spec.ts:10:34)
            at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:388:1)
            at Zone../node_modules/zone.js/dist/zone.js.Zone.run node_modules/zone.js/dist/zone.js:138:1)

            at Suite.<anonymous> node_modules/zone.js/dist/zone-testing.js:491:1)
            at Env.jasmineEnv.(anonymous function) [as describe] node_modules/zone.js/dist/zone-testing.js:424:1)
HeadlessChrome 65.0.3325 (Windows 10.0.0): Executed 1 of 3 (1 FAILED) (0 secs / 0 secs)
HeadlessChrome 65.0.3325 (Windows 10.0.0) (effect) book-collection When a draft is saved successfully encountered a declaration exception FAILED
        Error: No test scheduler initialized
            at getTestScheduler node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:265:1)
            at new TestHotObservable node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:303:1)
            at Object.hot node_modules/jasmine-marbles/bundles/jasmine-marbles.umd.js:313:1)
            at Suite.<anonymous> src/app/book/effects/book-collection.effects.spec.ts:10:34)
            at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke node_modules/zone.js/dist/zone.js:388:1)
            at Zone../node_modules/zone.js/dist/zone.js.Zone.run node_modules/zone.js/dist/zone.js:138:1)

            at Suite.<anonymous> node_modules/zone.js/dist/zone-testing.js:491:1)
            at Env.jasmineEnv.(anonymous function) [as describe] node_modules/zone.jHeadlessChrome 65.0.3325 (Windows 10.0.0): Executed 2 of 3 (1 FAILED) (0 secs / 0 seHeadlessChrome 65.0.3325 (Windows 10.0.0): Executed 3 of 3 (1 FAILED) (0 secs / 0 seHeadlessChrome 65.0.3325 (Windows 10.0.0): Executed 3 of 3 (1 FAILED) (0.116 secs / 0 secs)
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: C:\\WINDOWS\\system32\\cmd.exe
Arguments: /d /s /c ng test
Directory: C:\\workbench\\projects\\bern-18-04-10
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "C:\\workbench\\projects\\bern-18-04-10\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Please leave me a message if I can provide further information for you.

Kind Regards Gregor

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

5reactions
jkyoutseycommented, Jun 13, 2019

The answer as to how to fix this is on stackoverflow: https://stackoverflow.com/a/56364159/2486918

import { addMatchers, initTestScheduler } from 'jasmine-marbles';

beforeEach(() => {
  ...
  initTestScheduler();
  addMatchers();
});
5reactions
davidgallegolobatocommented, Jun 8, 2018

I reply myself to the issue: calling the method initTestScheduler() fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jasmine-marbles ~0.3.0 seems not to work with RxJS 6 #21
Running karma test runner throws the following error: HeadlessChrome 65.0.3325 (Windows 10.0.0) (effect) book-collection When a draft is saved ...
Read more >
ngrx/effects unit tests using jasmine-marbles - Stack Overflow
When I try to use either cold or hot functions from jasmine-marbles , I keep getting TypeError: Class constructor Observable cannot be invoked ......
Read more >
jasmine-marbles - npm
Marble testing helpers for RxJS and Jasmine. ... Start using jasmine-marbles in your project by running `npm i jasmine-marbles`.
Read more >
conflicting peer dependency: rxjs@6.6.7 - You.com | The Search ...
Use `--location=global` instead. npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: jasmine-marbles@0.8.4 npm WARN Found: rxjs@7.4.0 npm ...
Read more >
Testing RxJS Code with Marble Diagrams
This guide refers to usage of marble diagrams when using the new testScheduler.run(callback) . Some details here do not apply to using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found