Skip to content

Commit

Permalink
fix(HMS-3373): update msw and frontend-components-config
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfefer committed Jan 11, 2024
1 parent 2e0b54b commit 40b4a3f
Show file tree
Hide file tree
Showing 16 changed files with 1,515 additions and 704 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/provisioning-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

strategy:
matrix:
node-version: [16.14.0]
node-version: [18.19.0]

steps:
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions .rhcicd/build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export COMPONENT="provisioning"
export IMAGE="quay.io/cloudservices/provisioning-frontend"
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
export APP_ROOT=$(pwd)
export NODE_BUILD_VERSION=18
COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master

set -exv
Expand Down
2 changes: 1 addition & 1 deletion .rhcicd/pr_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export COMPONENT_NAME="provisioning-frontend" # name of resourceTemplate compon
export IMAGE="quay.io/cloudservices/provisioning-frontend"
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
export APP_ROOT=$(pwd)
# export NODE_BUILD_VERSION=16
export NODE_BUILD_VERSION=18
COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master

# --------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ module.exports = {
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
},
testEnvironmentOptions: {
customExportConditions: [''],
},
roots: ['<rootDir>/src/'],
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!(@patternfly|@redhat-cloud-services|@openshift|lodash-es|p-all)).*$',
'<rootDir>/node_modules/(?!(@patternfly|@redhat-cloud-services|@openshift|lodash-es|uuid|p-all)).*$',
],
testEnvironment: 'jsdom',
setupFiles: ['./jest.polyfills.js'],
setupFilesAfterEnv: ['<rootDir>/config/jest.setup.js'],
};
31 changes: 31 additions & 0 deletions jest.polyfills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// jest.polyfills.js
/**
* @note The block below contains polyfills for Node.js globals
* required for Jest to function when running JSDOM tests.
* These HAVE to be require's and HAVE to be in this exact
* order, since "undici" depends on the "TextEncoder" global API.
*
* Consider migrating to a more modern test runner if
* you don't want to deal with this.
*/

const { TextDecoder, TextEncoder, ReadableStream } = require("node:util")

Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
ReadableStream: { value: ReadableStream },
})

const { Blob, File } = require("node:buffer")
const { fetch, Headers, FormData, Request, Response } = require("undici")

Object.defineProperties(globalThis, {
fetch: { value: fetch, writable: true },
Blob: { value: Blob },
File: { value: File },
Headers: { value: Headers },
FormData: { value: FormData },
Request: { value: Request },
Response: { value: Response },
})
Loading

0 comments on commit 40b4a3f

Please sign in to comment.