Skip to content

Commit

Permalink
Merge pull request #62 from Suntgr/feaeture/test-node
Browse files Browse the repository at this point in the history
fix: resolve test failures in Node 20+ and below Node 17
  • Loading branch information
Kikobeats authored Feb 15, 2025
2 parents c48ec40 + c00d5cc commit 4c45679
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: lts/*
- name: Install
run: npm install --no-package-lock --force
- name: Test
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ unsafe-perm=true
loglevel=error
shamefully-hoist=true
resolution-mode=highest
engine-strict=true
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
"css-loader": "~4.3.0",
"enzyme": "~3.11.0",
"enzyme-adapter-react-16": "~1.15.5",
"finepack": "latest",
"github-generate-release": "latest",
"html-webpack-plugin": "^4.5.2",
"ignore-styles": "~5.0.1",
Expand Down Expand Up @@ -260,6 +261,9 @@
"webpack-cli": "~5.1.4",
"webpack-dev-server": "~5.0.4"
},
"engines": {
"node": ">=17"
},
"files": [
"dist",
"index.d.ts"
Expand Down
9 changes: 6 additions & 3 deletions test/testHelpers/requireSources.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ function setUpDomEnvironment () {

global.window = window
global.document = window.document
global.navigator = {
userAgent: 'node.js'
}
Object.defineProperty(global, 'navigator', {
value: {
userAgent: 'node.js'
},
writable: true
})
copyProps(window, global)
}

Expand Down

0 comments on commit 4c45679

Please sign in to comment.