From 05e462bd2b02d47d09b61306dc42a403d3e6a1f3 Mon Sep 17 00:00:00 2001 From: Peter Hauke <90506472+peterhauke@users.noreply.github.com> Date: Fri, 21 Jul 2023 18:48:57 +0200 Subject: [PATCH] Add output from a successful test run (#17793) Add output from a successful test run -- because the error output from a failed test run was presented above --- language/nodejs/run-tests.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/language/nodejs/run-tests.md b/language/nodejs/run-tests.md index 1e610f7027..91ab5b2ada 100644 --- a/language/nodejs/run-tests.md +++ b/language/nodejs/run-tests.md @@ -122,6 +122,18 @@ Run the command again, and this time rebuild the image to use the new Dockerfile $ docker compose -f docker-compose.dev.yml run --build notes npm run test ``` +When you run the tests this time, you should get the following output: + +```console +> mocha ./**/*.js + + Array + #indexOf() + ✔ should return -1 when the value is not present + + 1 passing (6ms) +``` + This image with dev dependencies installed is not suitable for a production image. Rather than creating multiple Dockerfiles, we can create a multi-stage Dockerfile to create an image for testing and an image for production. ### Multi-stage Dockerfile for testing