Skip to content

Commit

Permalink
chore: update node version (#2820)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-robitaille authored Nov 3, 2023
1 parent faffec3 commit 2ddb535
Show file tree
Hide file tree
Showing 9 changed files with 2,584 additions and 2,885 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Node.JS 16
- name: Node.JS 18
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Node.JS 16
- name: Node.JS 18
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -42,10 +42,10 @@ jobs:
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Node.JS 16
- name: Node.JS 18
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Node.JS 16
- name: Node.JS 18
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b

FROM node:18
ENV NODE_ENV=production

COPY . /src
Expand All @@ -17,13 +16,13 @@ RUN yarn install --silent --production=false
RUN yarn build
RUN yarn install --production

FROM node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b
FROM node:18

COPY flag_initialization /src
WORKDIR /src
RUN yarn install --silent

FROM node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b
FROM node:18
LABEL maintainer="-"

ARG COGNITO_REGION="ca-central-1"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.pr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Form viewier that runs as a Lambda function. It is used to create
# Lambda function review environments for each PR.
FROM node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b as build
FROM node:18 as build

ENV NODE_ENV=production
ENV NEXT_OUTPUT_STANDALONE=true
Expand All @@ -19,7 +19,7 @@ RUN yarn install --silent --production=false
RUN yarn build
RUN yarn install --production

FROM node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b as final
FROM node:18 as final
LABEL maintainer="-"

ARG COGNITO_REGION="ca-central-1"
Expand Down
2 changes: 1 addition & 1 deletion components/forms/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SubmitButton: React.FC<SubmitButtonProps> = ({
const [submitTooEarly, setSubmitTooEarly] = useState(false);
const screenReaderRemainingTime = useRef(formTimerState.remainingTime);
useEffect(() => {
let intervalID: NodeJS.Timer;
let intervalID: NodeJS.Timeout;
// calculate initial delay for submit timer
if (timerActive) {
const secondsBaseDelay = 2;
Expand Down
20 changes: 12 additions & 8 deletions jest.config.js → jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
const nextJest = require("next/jest");
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig");
import nextJest from "next/jest.js";
import { pathsToModuleNameMapper } from "ts-jest";
import { createRequire } from "node:module";

const require = createRequire(import.meta.url);
const { compilerOptions } = require("./tsconfig.json");
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: "./",
});

// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const customJestConfig = {
workerIdleMemoryLimit: "1G",
testPathIgnorePatterns: ["<rootDir>/cypress/", "<rootDir>/public/static/scripts/"],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>/" }),
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: "<rootDir>/",
}),
moduleDirectories: ["node_modules", "<rootDir>/"],
clearMocks: true,
preset: "ts-jest/presets/js-with-ts",
Expand All @@ -23,10 +29,8 @@ const customJestConfig = {
"<rootDir>/__utils__/setupTests.ts",
"<rootDir>/__utils__/prismaConnector.ts",
],
testEnvironment: "jsdom",
collectCoverage: false,
collectCoverageFrom: ["{pages,lib,components}/**/{!(*.stories),}.{ts,tsx}"],
testEnvironment: "jest-environment-jsdom",
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig);
export default createJestConfig(customJestConfig);
Loading

0 comments on commit 2ddb535

Please sign in to comment.