Add tests as a Docker build step to ensure no container with failing tests can be published

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface
2023-08-02 21:32:58 +01:00
parent ab2aa09861
commit 5504439ce0
5 changed files with 17 additions and 25 deletions

View File

@@ -3,6 +3,8 @@ WORKDIR /usr/src/app
COPY ./package*.json ./
RUN npm i
COPY . .
# Ideally the tests should be run separately in a CI/CD workflow rather than during the build
RUN npm run test
RUN npm run build
FROM node:20-slim