This is a test project to demonstrate using Intern with Angular 9+. Specs have been reformatted and converted to using Intern best practices as outlined below.
git clone https://github.com/francknoelkouassi-dev/project-cocktail
cd project-cocktail
Install the npm
packages described in the package.json
and verify that it works:
npm install
npm start
The npm start
command builds (compiles TypeScript and copies assets) the application into dist/
, watches for changes to the source files, and runs lite-server
on port 3000
.
Shut it down manually with Ctrl-C
.
These are the most useful commands defined in package.json
:
npm start
- runs the TypeScript compiler, asset copier, and a server at the same time, all three in "watch mode".npm run build
- runs the TypeScript compiler and asset copier once.npm run build:watch
- runs the TypeScript compiler and asset copier in "watch mode"; when changes occur to source files, they will be recompiled or copied intodist/
.npm run lint
- runstslint
on the project files.npm run serve
- runslite-server
.
These are the test-related scripts:
npm test
- builds the application and runs Intern tests (both unit and functional) one time.npm run ci
- cleans, lints, and builds the application and runs Intern tests (both unit and functional) one time.
Because Intern seamlessly handles asynchronous testing, there is no reason to use async
, fakeAsync
, or tick
from @angular/core/testing
. Furthermore, because TypeScript introduced downlevel asynchronous function support in version 2.1, the use of async
and await
has been leveraged to write these tests.