Skip to content

Developer Setup

Ronny Mikalsen edited this page Jan 18, 2022 · 23 revisions

This is a library for Angular, implementing the Angular Package Format v9.0.

Features:

  • the Mime IIIF viewer library
  • unit test for the library
  • a demo application that consumes the library in JIT mode and runs in watch mode
  • an integration app that consumes the library in JIT and AOT mode and runs e2e tests

Getting your environment set up

  1. Angular requires a current, active LTS, or maintenance LTS version of Node.js.
  2. Install Yarn (https://yarnpkg.com)
  3. Install Nrwl Extensions for Angular (Nx) (https://github.com/nrwl/nx)
  4. Fork the NationalLibraryOfNorway/ngx-mime repo.
  5. Clone your fork. Recommendation: name your git remotes upstream for NationalLibraryOfNorway/ngx-mime and <your-username> for your fork.
  6. From the root of the project, yarn install.

Common tasks are present as npm scripts:

  • yarn build to build the library
  • yarn start:demo to run a live-reload server with the demo app
  • You can test one project, like this: ng test ngx-mime
  • You can test all projects using yarn affected:*, like this: yarn affected:test --all
  • Ideally, though, you would only retest the things that were affected by your change: yarn affected:test --base=master --head=HEAD
  • And you can also do it in parallel: yarn affected:test --base=master --head=HEAD --parallel
  • Retest only the failed projects that: yarn affected:test --base=master --head=HEAD --parallel --only-failed
  • yarn affected:lint --all to lint
  • yarn e2e to run e2e tests on chrome
  • yarn e2e:chrome to run e2e tests on chrome
  • yarn e2e:firefox to run e2e tests on firefox
  • See https://yarnpkg.com/lang/en/docs/cli/link/ to test locally in another app

When working with e2e tests:

  • yarn mountebank to start api mock
  • yarn start:integration to start integration app

To run all protractor tests on chrome

  • yarn protractor:chrome or yarn protractor:chrome:headless

To run all protractor tests on firefox

  • yarn protractor:firefox

To run specific tests:

  • protractor apps/integration-e2e/protractor.conf.js --browser=chrome --tags=@desktop --feature=zoom --headless

Clone this wiki locally