Skip to content

Commit

Permalink
Upgrade jest and rollup in rrweb-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 committed Dec 4, 2023
1 parent dc52b38 commit ecf7863
Show file tree
Hide file tree
Showing 5 changed files with 774 additions and 655 deletions.
12 changes: 11 additions & 1 deletion packages/rrweb-snapshot/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/**.test.ts'],
setupFiles: ['./jest.setup.ts'],
/**
* Keeps old (pre-jest 29) snapshot format
* its a bit ugly and harder to read than the new format,
* so we might want to remove this in its own PR
*/
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
};
3 changes: 3 additions & 0 deletions packages/rrweb-snapshot/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { TextEncoder, TextDecoder } from 'util';

Object.assign(global, { TextDecoder, TextEncoder });
20 changes: 11 additions & 9 deletions packages/rrweb-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"test:update": "jest --updateSnapshot",
"bundle": "rollup --config",
"bundle:es-only": "cross-env ES_ONLY=true rollup --config",
"dev": "yarn bundle:es-only --watch",
"typings": "tsc -d --declarationDir typings",
"dev": "yarn bundle:es-only --watch & yarn typings -w",
"check-types": "tsc --noEmit",
"typings": "tsc -d --declarationDir typings --emitDeclarationOnly",
"prepublish": "yarn typings && yarn bundle",
"lint": "yarn eslint src"
},
Expand Down Expand Up @@ -44,19 +45,20 @@
"homepage": "https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-snapshot#readme",
"devDependencies": {
"@types/chai": "^4.1.4",
"@types/jest": "^27.0.2",
"@types/jsdom": "^20.0.0",
"@types/jest": "^29.5.10",
"@types/jsdom": "^21.1.6",
"@types/node": "^18.15.11",
"@types/puppeteer": "^1.12.4",
"cross-env": "^5.2.0",
"jest": "^27.2.4",
"jest": "^29.7.0",
"jest-snapshot": "^23.6.0",
"jsdom": "^16.4.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^23.0.0",
"puppeteer": "^17.1.3",
"rollup": "^2.45.2",
"rollup": "^2.47.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"ts-jest": "^27.0.5",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^29.1.1",
"ts-node": "^7.0.1",
"tslib": "^1.9.3"
}
Expand Down
1 change: 1 addition & 0 deletions packages/rrweb-snapshot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"module": "ESNext",
"target": "ES6",
"moduleResolution": "Node",
"esModuleInterop": true,
"noImplicitAny": true,
"strictNullChecks": true,
"removeComments": true,
Expand Down
Loading

0 comments on commit ecf7863

Please sign in to comment.