Skip to content

Commit 66f8b34

Browse files
committed
Some fixes
1 parent 8fbe6f9 commit 66f8b34

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
],
3030
"dependencies": {
3131
"canvas": "^2.10.2",
32-
"jsdom": "^20.0.3",
32+
"jsdom": "^25.0.1",
3333
"phaser3spectorjs": "npm:[email protected]"
3434
},
3535
"devDependencies": {
36-
"@types/jsdom": "^20.0.1",
36+
"@tsconfig/node18": "^18.2.4",
37+
"@types/jsdom": "^21.1.7",
3738
"@types/node": "^16.4.0",
3839
"@yandeu/prettier-config": "^0.0.3",
3940
"axios": "^0.24.0",
@@ -43,7 +44,7 @@
4344
"nodemon": "^2.0.4",
4445
"npm-run-all": "^4.1.5",
4546
"phaser": "^3.60.0",
46-
"typescript": "^4.3.5"
47+
"typescript": "^5.7.2"
4748
},
4849
"directories": {
4950
"lib": "lib"
@@ -59,4 +60,4 @@
5960
"funding": {
6061
"url": "https://github.com/sponsors/yandeu"
6162
}
62-
}
63+
}

src/fakeScreen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
global.screen = {
2+
// @ts-expect-error
3+
orientation: {
4+
addEventListener: () => {}
5+
}
6+
}

src/fakeXMLHttpRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import path from 'path'
22
import fs from 'fs'
33

44
class FakeXMLHttpRequest {
5-
public url: string
5+
public url!: string
66
public status = 200
77
public response: any
8-
public responseText: string
8+
public responseText: string | undefined
99

1010
public open(_type: string, url: string) {
1111
this.url = path.resolve(__dirname, url)

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare global {
55
import Canvas from 'canvas'
66
import jsdom from 'jsdom'
77
import FakeXMLHttpRequest from './fakeXMLHttpRequest'
8+
import './fakeScreen'
89

910
const { JSDOM } = jsdom
1011
const dom = new JSDOM(`<!DOCTYPE html><body></body>`)

tsconfig.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
2+
"extends": "@tsconfig/node18/tsconfig.json",
23
"compilerOptions": {
3-
"target": "ES2015",
4-
"module": "CommonJS",
5-
64
"rootDir": "./src",
75
"outDir": "./lib",
86

7+
"lib": ["es2023", "dom"],
8+
99
"sourceMap": true,
1010
"declaration": true,
11-
"declarationMap": true,
12-
13-
"esModuleInterop": true,
14-
"strict": true,
15-
"strictPropertyInitialization": false
11+
"declarationMap": true
1612
}
1713
}

0 commit comments

Comments
 (0)