Configuring testing environment

For a lightweight testing environment, we will be leveraging an Alpine-based installation of the Chromium browser:

  1. Inherit from slapers/alpine-node-chromium
  2. Append the following configuration to Docker.integration:
Docker.integration...FROM slapers/alpine-node-chromium as testerENV BUILDER_SRC_DIR /usr/srcENV SRC_DIR /usr/srcENV TEST_SCRIPT test:prodRUN mkdir -p $SRC_DIRWORKDIR $SRC_DIRCOPY --from=builder $BUILDER_SRC_DIR $SRC_DIRCMD 'npm run $TEST_SCRIPT'

The preceding script will copy the production build from the builder stage and execute your test scripts in a predictable manner.

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.