refactor the test infra: use puppeteer instead of jsdom to get rid of some hack implementations

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 0e35b86d87
commit 7fadc986ec
9 changed files with 125 additions and 72 deletions

View File

@@ -4,7 +4,8 @@
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",
"main": "index.js",
"scripts": {
"test": "TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts"
"test": "TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts",
"compile": "rollup --config"
},
"repository": {
"type": "git",
@@ -23,14 +24,16 @@
"homepage": "https://github.com/rrweb-io/rrweb-snapshot#readme",
"devDependencies": {
"@types/chai": "^4.1.4",
"@types/jsdom": "^11.12.0",
"@types/mocha": "^5.2.5",
"@types/node": "^10.11.3",
"@types/puppeteer": "^1.8.0",
"chai": "^4.1.2",
"jsdom": "^12.1.0",
"mocha": "^5.2.0",
"mocha-jsdom": "^2.0.0",
"puppeteer": "^1.9.0",
"rollup": "^0.66.4",
"rollup-plugin-typescript": "^1.0.0",
"ts-node": "^7.0.1",
"tslib": "^1.9.3",
"tslint": "^4.5.1",
"typescript": "^3.0.3"
}