A tool that makes it really easy to run your Jasmine tests in a browser.
It doesn't require any extra setup on your part, and you are not required to be using Gulp or Webpack or even Babel in your project.
You should have
node and either
npm installed, and you should have some tests written with Jasmine.
First, install it:
yarn add -D run-jasmine-browser# ornpm i run-jasmine-browser --save-dev
Then, import it and start up the test server with one function call!
For example, in
const runTests = ;// with default options:;// or, with options:;
Then, you would run
node run-tests.js to start up the Jasmine server.
Better yet, put it in an NPM script in your
Then, it would just be
yarn test or
npm test to start up the test server.
As shown above, you can pass an options object to configure the way the tests are run. Here are the options:
Pattern to use to find test files that Jasmine will run.
Options to pass directly to Babel, which will transpile your code before running the tests.
default: Transpiles using
babel-preset-react. If you're writing ES6 and/or React code with JSX, there's a good chance you won't need to specify anything here.