Skip to content

Can't run README.md examples #571

@KhalfaniW

Description

@KhalfaniW

Description:

I can't run the examples in the README. I don't know how to run any tests.

Example Test (failing):

it('Should concatenate two cold observables into single cold observable', () => {
    const a = cold('-a-|');
    const b = cold('-b-|');
    const expected = '-a--b-|';
    expect(a.pipe(concat(b))).toBeMarble(expected);
});

Error Message:

TypeError: pipe_1.pipeFromArray(...) is not a function

      5 |     const b = cold('-b-|');
      6 |     const expected = '-a--b-|';
    > 7 |     expect(a.pipe(concat(b))).toBeMarble(expected);
        |              ^
      8 | });
      9 |

      at ColdObservable.Object.<anonymous>.Observable.pipe (node_modules/rxjs/src/internal/Observable.ts:437:37)
      at Object.pipe (__tests__/x.js:7:14)

package.json:

{
  "name": "tmp-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",    
  "type":"module",
  "scripts": {
    "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "jest": "^29.5.0",
    "jest-marbles": "^3.1.0"
  },
  "dependencies": {
    "rxjs": "^7.0.1"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions