Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GregOnNet opened this issue Apr 16, 2018 · 5 comments · Fixed by #41
Closed

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

GregOnNet opened this issue Apr 16, 2018 · 5 comments · Fixed by #41

Comments

@GregOnNet
Copy link

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

@davidgallegolobato
Copy link

Any progress on this? I am facing the same issue.

Thanks.

@davidgallegolobato
Copy link

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

@Rlcolli4
Copy link

Rlcolli4 commented Jun 4, 2019

I am having the same problem, we ran ng update @angular/cli @angular/core and everything else worked with out an issue, but after running our unit tests, we saw all our effects tests failing. We get stack traces similar to the following.

Screen Shot 2019-06-04 at 11 16 11 AM

I can provide information on version of angular if needed.

(EDIT) Trying davidgallegolobato's fix just caused another error.

@jkyoutsey
Copy link

Angular 8.0.0 and RxJS 6.5.2 has this issue as well.

@jkyoutsey
Copy link

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();
});

brandonroberts added a commit that referenced this issue Jun 18, 2019
This check is no longer needed and prevents the setup logic from
running when tests are compiled to es2015

Closes #21, #37, #40
brandonroberts added a commit that referenced this issue Jun 18, 2019
… exports check

This check is no longer needed and prevents the setup logic from
running when tests are compiled to es2015

Closes #21, #37, #40
brandonroberts added a commit that referenced this issue Jun 18, 2019
… exports check (#41)

This check is no longer needed and prevents the setup logic from
running when tests are compiled to es2015

Closes #21, #37, #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants