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 tester
ENV BUILDER_SRC_DIR /usr/src
ENV SRC_DIR /usr/src
ENV TEST_SCRIPT test:prod

RUN mkdir -p $SRC_DIR
WORKDIR $SRC_DIR

COPY --from=builder $BUILDER_SRC_DIR $SRC_DIR

CMD '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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181