The JSPM skeleton comes with a pretty complete set of Gulp tasks. These tasks can be found in the build/tasks
directory.
The first thing you'll probably want to do is to run the sample application from the skeleton. This can be done by opening a console in the project directory and running the following command:
> gulp watch
This command launches a development web server with a watcher process which will refresh the browser every time a source file changes.
If you want to run the application without watching the files and automatically refreshing the browser, you can do it by running the serve
task:
> gulp serve
By default, the JSPM skeleton's unit tests can be found in the test/unit
directory. It also typically contains three different Gulp tasks related to unit tests:
test
: Runs the unit tests oncetdd
: Runs the unit tests once, then watches the files and reruns the tests when the code changescover
: Runs the unit tests once with code coverage enabled using Istanbul (https://github.com/gotwarlost/istanbul)
For example, if you want to do some test-driven development and have your tests run continuously while you code, you can run the following command:
> gulp tdd
Since the skeleton relies on Karma to run the tests, you need to install the Karma CLI on your environment before running any of the tasks above:
> npm install -g karma-cli
The JSPM skeleton also contains an e2e
task, which will launch the end-to-end tests found in the test/e2e/src
directory.
However, since the end-to-end tests rely on Protractor, you first need to update the Selenium drivers by running the proper task:
> gulp webdriver-update
Then, since the E2E tests need to interact with the application itself, you need to launch the application:
> gulp serve
Finally, you can open a second console and launch the E2E tests:
> gulp e2e