handle timezone correctly in docker build
Run unit tests / test (pull_request) Successful in 1m53s Details
Compile the repository / compile (pull_request) Successful in 1m10s Details

This commit is contained in:
mightypanders 2023-06-24 20:31:37 +02:00
parent af414d0bad
commit 37b798818c
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,6 @@
FROM node:alpine as files FROM node:alpine as files
ENV TZ="Europe/Berlin"
WORKDIR /app WORKDIR /app
COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ] COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ]
COPY server ./server COPY server ./server
@ -18,5 +18,4 @@ RUN npm ci
FROM dependencies as test FROM dependencies as test
COPY jest.config.js . COPY jest.config.js .
COPY tests ./tests COPY tests ./tests
RUN npm run test RUN npm run test

View File

@ -10,7 +10,7 @@ function getTestDate(date: string): GuildScheduledEvent {
return <GuildScheduledEvent>{ scheduledStartAt: new Date(date) } return <GuildScheduledEvent>{ scheduledStartAt: new Date(date) }
} }
test('createDateStringFromEvent - correct formatting', () => { test('createDateStringFromEvent - correct formatting', () => {
expect(createDateStringFromEvent(getTestDate('01-01-2023 12:30'), "")).toEqual('heute um 13:30') expect(createDateStringFromEvent(getTestDate('01-01-2023 12:30'), "")).toEqual('heute um 12:30')
expect(createDateStringFromEvent(getTestDate('01-02-2023 12:30'), "")).toEqual('am Montag 02.01 um 13:30') expect(createDateStringFromEvent(getTestDate('01-02-2023 12:30'), "")).toEqual('am Montag 02.01 um 12:30')
expect(createDateStringFromEvent(getTestDate('01-03-2023 12:30'), "")).toEqual('am Dienstag 03.01 um 13:30') expect(createDateStringFromEvent(getTestDate('01-03-2023 12:30'), "")).toEqual('am Dienstag 03.01 um 12:30')
}) })