Fix Dockerfile build to actually run tests and fix a unit test
Signed-off-by: Michael Irwin <mikesir87@gmail.com>
This commit is contained in:
parent
b6ea4168d4
commit
2bca273ff4
@ -5,7 +5,7 @@ WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
FROM node:12-alpine AS app-base
|
||||
FROM node:18-alpine AS app-base
|
||||
WORKDIR /app
|
||||
COPY app/package.json app/yarn.lock ./
|
||||
COPY app/spec ./spec
|
||||
@ -13,13 +13,12 @@ COPY app/src ./src
|
||||
|
||||
# Run tests to validate app
|
||||
FROM app-base AS test
|
||||
RUN apk add --no-cache python3 g++ make
|
||||
RUN yarn install
|
||||
RUN yarn test
|
||||
|
||||
# Clear out the node_modules and create the zip
|
||||
FROM app-base AS app-zip-creator
|
||||
COPY app/package.json app/yarn.lock ./
|
||||
COPY --from=test /app/package.json /app/yarn.lock ./
|
||||
COPY app/spec ./spec
|
||||
COPY app/src ./src
|
||||
RUN apk add zip && \
|
||||
|
@ -1,9 +1,9 @@
|
||||
const db = require('../../src/persistence');
|
||||
const addItem = require('../../src/routes/addItem');
|
||||
const ITEM = { id: 12345 };
|
||||
const uuid = require('uuid/v4');
|
||||
const {v4 : uuid} = require('uuid');
|
||||
|
||||
jest.mock('uuid/v4', () => jest.fn());
|
||||
jest.mock('uuid', () => ({ v4: jest.fn() }));
|
||||
|
||||
jest.mock('../../src/persistence', () => ({
|
||||
removeItem: jest.fn(),
|
||||
|
Loading…
Reference in New Issue
Block a user