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

Can't run README.md examples #571

Open
KhalfaniW opened this issue Oct 3, 2024 · 1 comment
Open

Can't run README.md examples #571

KhalfaniW opened this issue Oct 3, 2024 · 1 comment

Comments

@KhalfaniW
Copy link

KhalfaniW commented Oct 3, 2024

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"
  }
}
@KhalfaniW KhalfaniW changed the title Can't run README.md examples TypeError: pipe_1.pipeFromArray(...) is not a function Can't run README.md examples: TypeError: pipe_1.pipeFromArray(...) is not a function Oct 3, 2024
@KhalfaniW KhalfaniW changed the title Can't run README.md examples: TypeError: pipe_1.pipeFromArray(...) is not a function Can't run README.md examples. TypeError: pipe_1.pipeFromArray(...) is not a function Oct 3, 2024
@KhalfaniW
Copy link
Author

The new syntax is

   expect(concat(a,b)).toBeMarble(expected);

The examples not being updated is confusing to beginners like myself

@KhalfaniW KhalfaniW changed the title Can't run README.md examples. TypeError: pipe_1.pipeFromArray(...) is not a function Can't run README.md examples Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant