From 3d602869ed19ebbc781c408feaad2c8f84d94b6f Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Tue, 9 Aug 2022 00:41:19 +0200 Subject: [PATCH] Fix jest puppeteer config --- package.json | 8 ++++---- src/test/jest.d.ts | 2 +- yarn.lock | 9 ++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3152dea..7e51c63 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,11 @@ "main": "dist/index.js", "types": "dist/index.d.js", "scripts": { - "test": "jest", - "test:ci": "jest --colors --silent", - "test:debug": "cross-env HEADLESS=false jest --testTimeout=100000000", + "test": "cross-env JEST_PUPPETEER_CONFIG=jest-puppeteer.config.cjs jest", + "test:ci": "cross-env JEST_PUPPETEER_CONFIG=jest-puppeteer.config.cjs jest --colors --silent", + "test:debug": "cross-env JEST_PUPPETEER_CONFIG=jest-puppeteer.config.cjs HEADLESS=false jest --testTimeout=100000000", "build": "tsc", "watch": "tsc -w", - "prepare": "npm run build", "lint": "eslint src scripts", "summary-table": "npm run build && node --experimental-specifier-resolution=node --loader ts-node/esm scripts/summary-table.ts" }, @@ -29,6 +28,7 @@ "@types/turndown": "^5.0.1", "@typescript-eslint/eslint-plugin": "^5.32.0", "@typescript-eslint/parser": "^5.32.0", + "cross-env": "^7.0.3", "eslint": "8.7.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0", diff --git a/src/test/jest.d.ts b/src/test/jest.d.ts index 8ecc3dc..3fbfb73 100644 --- a/src/test/jest.d.ts +++ b/src/test/jest.d.ts @@ -5,7 +5,7 @@ declare global { namespace jest { interface Matchers { // The `= undefined` part is incorrect according to VSCode, but it is actually required. - toHaveTag(tagName: string, tagCategory: TagCategory | undefined): R; + toHaveTag(tagName: string, tagCategory: TagCategory | undefined = undefined): R; toHaveNote(noteText: string): R; toHaveResolution(resolution: [number, number]): R; } diff --git a/yarn.lock b/yarn.lock index f1d443d..3647e49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1563,6 +1563,13 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" + integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1574,7 +1581,7 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0, cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==