Skip to content

RxJS playground with Node.js, TypeScript and Jasmine

Notifications You must be signed in to change notification settings

dtgoitia/rxjs-playground

Repository files navigation

Node,js, TypeScript, RxJS and Jasmine playground

Set up

Locally

To use this playground in your machine, clone and install the repository:

git clone git@github.com:dtgoitia/rxjs-playground.git
cd rx-playground
npm ci

Installation free

You can access a remote container from your browser. This is a good option if you don't want to install anything in your machine.

To do so, use GitPod to spin-up a container for free for you. Once the container is loaded, the tests will automatically run in watch mode.

Usage

Add your files under src/ and ensure your files containing tests end up with .spec.ts. Otherwise, Jasmine will not pick them up.

Run the tests in watch-mode:

npm run test-watch

Run the tests only once:

npm test

Being in watch-mode:

  • type rs and press ENTER to run the test suit again.
  • press Ctrl + C to exit watch mode

Debugging

Jasmine allows you to use the old console.log, console.dir.

Configuration

Configuration files:

  • Nodemon: nodemon.json
  • Node TS: tsconfig.json
  • Jasmine: spec/support/jasmine.json

Actual setup:

  • nodemon is configured to use execute jasmine-ts.
  • jasmine-ts will by default pick Jasmine's JavaScript configuration (not changed).
  • jasmine-ts will use node-ts.

Jasmine is set up to use reporters for a cleaner test output.