diff --git a/.build/build.sh b/.build/build.sh deleted file mode 100755 index 1e029b7f..00000000 --- a/.build/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -e - -export NVM_DIR="$HOME/.nvm" -[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" - -if [[ $# -lt 1 ]]; then -echo "No working directory provided, using default" -targetDir=$PWD -else -targetDir=$1 -fi -if [[ $# -lt 2 ]]; then -echo "No node version provided, using default" -nodeVersion="lts/dubnium" -else -nodeVersion=$2 -fi - -echo "Entering working directory $targetDir" -cd $targetDir -echo "Installing node version $nodeVersion" -nvm install $nodeVersion - -npm ci -E2E_TEST=1 npm run coverage -- --coverageDirectory=coverage/e2e diff --git a/.build/run_linux.sh b/.build/run_linux.sh deleted file mode 100755 index 12d5b9ed..00000000 --- a/.build/run_linux.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo $PWD - -npm ci -echo "npm run compile" -npm run compile -echo "init e2e test subpackage" -npm --prefix e2e/tests ci -echo "npm run coverage" -npm run coverage:clean -npm run coverage -- --coverageDirectory=coverage/unit -docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${TRAVIS_NODE_VERSION}" -npm run coverage:merge -npm run coverage:merge-report \ No newline at end of file diff --git a/.build/run_osx.sh b/.build/run_osx.sh deleted file mode 100755 index 39484521..00000000 --- a/.build/run_osx.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo $PWD - -npm ci -npm run compile -npm --prefix e2e/tests ci -npm test diff --git a/.build/setup_linux.sh b/.build/setup_linux.sh deleted file mode 100755 index aaa0eb51..00000000 --- a/.build/setup_linux.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -sudo apt-get update -sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce -docker pull s1hofmann/nut-ci:latest -docker run -it -d --name nut-ci --shm-size 4gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash \ No newline at end of file diff --git a/.build/setup_osx.sh b/.build/setup_osx.sh deleted file mode 100755 index 0510f2c0..00000000 --- a/.build/setup_osx.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -set -e diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fa4a9ae7..dfe2c7b4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,10 +20,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18 - - name: Setup Docker - run: | - docker pull s1hofmann/nut-ci:latest - docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash - name: Install run: npm ci - name: Compile @@ -34,10 +30,10 @@ jobs: run: npm run coverage:clean - name: Generate coverage report uses: GabrielBB/xvfb-action@v1 + env: + NODE_OPTIONS: "--max-old-space-size=8192" with: run: npm run coverage -- --coverageDirectory=coverage/unit - - name: Run Docker E2E tests - run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} 14" - name: Run Electron e2e test subpackage uses: GabrielBB/xvfb-action@v1 with: @@ -78,7 +74,7 @@ jobs: with: run: | npx playwright install --with-deps - npm run coverage -- --coverageDirectory=coverage/unit + npm test - name: Run Electron e2e test subpackage uses: GabrielBB/xvfb-action@v1 with: diff --git a/.github/workflows/snapshot_release.yaml b/.github/workflows/snapshot_release.yaml index 5a1eabce..8d5588f5 100644 --- a/.github/workflows/snapshot_release.yaml +++ b/.github/workflows/snapshot_release.yaml @@ -24,11 +24,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{matrix.node}} - - name: Setup Docker - if: ${{matrix.os == 'ubuntu-latest'}} - run: | - docker pull s1hofmann/nut-ci:latest - docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash - name: Install run: npm ci - name: Install @nut-tree/libnut@next @@ -43,9 +38,6 @@ jobs: run: | npx playwright install --with-deps npm test - - name: Run Docker E2E tests - if: ${{matrix.os == 'ubuntu-latest'}} - run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} 14" - name: Run Electron e2e test subpackage uses: GabrielBB/xvfb-action@v1 with: diff --git a/.github/workflows/tagged_release.yaml b/.github/workflows/tagged_release.yaml index 756ffd2f..53c92732 100644 --- a/.github/workflows/tagged_release.yaml +++ b/.github/workflows/tagged_release.yaml @@ -18,11 +18,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{matrix.node}} - - name: Setup Docker - if: ${{matrix.os == 'ubuntu-latest'}} - run: | - docker pull s1hofmann/nut-ci:latest - docker run -it -d --name nut-ci --shm-size 8gb --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash - name: Install run: npm ci - name: Compile @@ -35,9 +30,6 @@ jobs: run: | npx playwright install --with-deps npm test - - name: Run Docker E2E tests - if: ${{matrix.os == 'ubuntu-latest'}} - run: docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${{matrix.node}}" - name: Run Electron e2e test subpackage uses: GabrielBB/xvfb-action@v1 with: diff --git a/lib/clipboard.class.e2e.spec.ts b/lib/clipboard.class.e2e.spec.ts deleted file mode 100644 index eef79f47..00000000 --- a/lib/clipboard.class.e2e.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ClipboardClass } from "./clipboard.class"; -import providerRegistry from "./provider/provider-registry.class"; - -describe("Clipboard class", () => { - it("should paste copied input from system clipboard.", async () => { - const SUT = new ClipboardClass(providerRegistry); - - const textToCopy = "bar"; - - SUT.setContent(textToCopy); - await expect(SUT.getContent()).resolves.toEqual(textToCopy); - }); -}); diff --git a/lib/expect/jest.matcher.function.ts b/lib/expect/jest.matcher.function.ts index 2302ce48..393ab63f 100644 --- a/lib/expect/jest.matcher.function.ts +++ b/lib/expect/jest.matcher.function.ts @@ -4,6 +4,9 @@ import { toBeAt } from "./matchers/toBeAt.function"; import { toBeIn } from "./matchers/toBeIn.function"; import { toShow } from "./matchers/toShow.function"; import { FindInput } from "../screen.class"; +import { RGBA } from "../rgba.class"; +import { toHaveColor } from "./matchers/toHaveColor.function"; +import { OptionalSearchParameters } from "../optionalsearchparameters.class"; declare global { namespace jest { @@ -11,10 +14,11 @@ declare global { toBeAt: (position: Point) => ReturnType; toBeIn: (region: Region) => ReturnType; // @ts-ignore - toShow: ( + toShow: ( needle: FindInput, - confidence?: number + parameters?: OptionalSearchParameters, ) => ReturnType; + toHaveColor: (color: RGBA) => ReturnType; } } } @@ -23,4 +27,5 @@ export const jestMatchers = { toBeAt, toBeIn, toShow, + toHaveColor, }; diff --git a/lib/expect/matchers/toBeAt.function.e2e.spec.ts b/lib/expect/matchers/toBeAt.function.spec.ts similarity index 79% rename from lib/expect/matchers/toBeAt.function.e2e.spec.ts rename to lib/expect/matchers/toBeAt.function.spec.ts index ed589c33..7bcec6f4 100644 --- a/lib/expect/matchers/toBeAt.function.e2e.spec.ts +++ b/lib/expect/matchers/toBeAt.function.spec.ts @@ -2,21 +2,17 @@ import { mouse } from "../../../index"; import { Point } from "../../point.class"; import { toBeAt } from "./toBeAt.function"; -jest.mock("jimp", () => {}); - const targetPoint = new Point(100, 100); describe(".toBeAt", () => { - beforeEach(() => { - mouse.setPosition(targetPoint); - }); - it("should succeed when cursor is at right position.", async () => { + mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint)); const result = await toBeAt(mouse, targetPoint); expect(result.pass).toBeTruthy(); }); it("should fail when cursor is at wrong position.", async () => { + mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint)); const result = await toBeAt(mouse, new Point(10, 10)); expect(result.pass).toBeFalsy(); }); diff --git a/lib/expect/matchers/toBeIn.function.e2e.spec.ts b/lib/expect/matchers/toBeIn.function.spec.ts similarity index 83% rename from lib/expect/matchers/toBeIn.function.e2e.spec.ts rename to lib/expect/matchers/toBeIn.function.spec.ts index 57269bc5..ff26421c 100644 --- a/lib/expect/matchers/toBeIn.function.e2e.spec.ts +++ b/lib/expect/matchers/toBeIn.function.spec.ts @@ -3,24 +3,19 @@ import { Point } from "../../point.class"; import { Region } from "../../region.class"; import { toBeIn } from "./toBeIn.function"; -jest.mock("jimp", () => {}); - const targetPoint = new Point(400, 400); describe(".toBeIn", () => { - beforeEach(() => { - mouse.setPosition(targetPoint); - }); - it("should succeed when cursor is within correct region.", async () => { const targetRegion = new Region(350, 350, 100, 100); + mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint)); const result = await toBeIn(mouse, targetRegion); expect(result.pass).toBeTruthy(); }); it("should fail when cursor is outside of search region.", async () => { const targetRegion = new Region(0, 0, 100, 100); - mouse.setPosition(targetPoint); + mouse.getPosition = jest.fn(() => Promise.resolve(targetPoint)); const result = await toBeIn(mouse, targetRegion); expect(result.pass).toBeFalsy(); }); diff --git a/lib/expect/matchers/toHaveColor.function.spec.ts b/lib/expect/matchers/toHaveColor.function.spec.ts new file mode 100644 index 00000000..81797b9b --- /dev/null +++ b/lib/expect/matchers/toHaveColor.function.spec.ts @@ -0,0 +1,66 @@ +import { RGBA, screen } from "../../../index"; +import { Point } from "../../point.class"; +import { mockPartial } from "sneer"; +import { toHaveColor } from "./toHaveColor.function"; + +// jest.mock("jimp", () => {}); + +const targetPoint = new Point(400, 400); + +describe(".toHaveColor", () => { + it("should succeed when screen pixel has the correct RGBA value", async () => { + // GIVEN + screen.colorAt = mockPartial(() => { + return new RGBA(0, 0, 0, 0); + }); + + // WHEN + const result = await toHaveColor(targetPoint, new RGBA(0, 0, 0, 0)); + + // THEN + expect(result.pass).toBeTruthy(); + }); + + it("should fail when the screen pixel has the incorrect RGBA value", async () => { + // GIVEN + screen.colorAt = mockPartial(() => { + return new RGBA(255, 0, 5, 0); + }); + + // WHEN + const result = await toHaveColor(targetPoint, new RGBA(0, 0, 0, 0)); + + // THEN + expect(result.pass).toBeFalsy(); + }); + + it("should succeed when the screen pixel has the correct RGBA value", async () => { + // GIVEN + screen.colorAt = mockPartial(() => { + return new RGBA(0, 0, 0, 0); + }); + expect.extend({ + toHaveColor, + }); + + // WHEN + + // THEN + await expect(targetPoint).toHaveColor(new RGBA(0, 0, 0, 0)); + }); + + it("should succeed when the screen pixel has the incorrect RGBA value", async () => { + // GIVEN + screen.colorAt = mockPartial(() => { + return new RGBA(255, 0, 5, 0); + }); + expect.extend({ + toHaveColor, + }); + + // WHEN + + // THEN + await expect(targetPoint).not.toHaveColor(new RGBA(0, 0, 0, 0)); + }); +}); diff --git a/lib/expect/matchers/toHaveColor.function.ts b/lib/expect/matchers/toHaveColor.function.ts new file mode 100644 index 00000000..80808cc0 --- /dev/null +++ b/lib/expect/matchers/toHaveColor.function.ts @@ -0,0 +1,19 @@ +import { Point, RGBA, screen } from "../../../index"; + +export const toHaveColor = async (received: Point, needle: RGBA) => { + const color = await screen.colorAt(received); + const match = color.toHex() === needle.toHex(); + if (match) { + return { + message: () => + `Expected pixel ${received.toString()} not to to have color ${needle.toHex()}`, + pass: true, + }; + } else { + return { + message: () => + `Expected pixel ${received.toString()} to have color ${needle.toHex()} but is ${color.toHex()}`, + pass: false, + }; + } +}; diff --git a/lib/expect/matchers/toShow.function.ts b/lib/expect/matchers/toShow.function.ts index 8aa55039..00ae7706 100644 --- a/lib/expect/matchers/toShow.function.ts +++ b/lib/expect/matchers/toShow.function.ts @@ -1,27 +1,44 @@ import { FindInput, ScreenClass } from "../../screen.class"; import { OptionalSearchParameters } from "../../optionalsearchparameters.class"; +import { isRegion, Region } from "../../region.class"; +import { screen } from "../../../index"; -export const toShow = async ( - received: ScreenClass, +export const toShow = async ( + received: ScreenClass | Region, needle: FindInput, - confidence?: number + parameters?: OptionalSearchParameters, ) => { - let locationParams; - if (confidence) { - locationParams = new OptionalSearchParameters(); - locationParams.confidence = confidence; - } const identifier = (await needle).id; - try { - await received.find(needle, locationParams); - return { - message: () => `Expected screen to not show ${identifier}`, - pass: true, - }; - } catch (err) { - return { - message: () => `Screen is not showing ${identifier}: ${err}`, - pass: false, - }; + if (isRegion(received)) { + if (parameters != null) { + parameters.searchRegion = received; + } else { + parameters = { searchRegion: received }; + } + try { + await screen.find(needle, parameters); + return { + message: () => `Expected screen to not show ${identifier}`, + pass: true, + }; + } catch (err) { + return { + message: () => `Screen is not showing ${identifier}: ${err}`, + pass: false, + }; + } + } else { + try { + await received.find(needle, parameters); + return { + message: () => `Expected screen to not show ${identifier}`, + pass: true, + }; + } catch (err) { + return { + message: () => `Screen is not showing ${identifier}: ${err}`, + pass: false, + }; + } } }; diff --git a/lib/generate-output-path.function.ts b/lib/generate-output-path.function.ts index bd41eeed..b39adfbd 100644 --- a/lib/generate-output-path.function.ts +++ b/lib/generate-output-path.function.ts @@ -14,12 +14,12 @@ export const generateOutputPath = ( path?: string; prefix?: string; postfix?: string; - } + }, ) => { const name = parse(filename).name; - const imageType = params && params.type ? params.type : FileType.PNG; - const path = params && params.path ? params.path : cwd(); - const prefix = params && params.prefix ? params.prefix : ""; - const postfix = params && params.postfix ? params.postfix : ""; + const imageType = params?.type ? params.type : FileType.PNG; + const path = params?.path ? params.path : cwd(); + const prefix = params?.prefix ? params.prefix : ""; + const postfix = params?.postfix ? params.postfix : ""; return join(path, `${prefix}${name}${postfix}${imageType}`); }; diff --git a/lib/screen.class.ts b/lib/screen.class.ts index c46b6042..27a72e9c 100644 --- a/lib/screen.class.ts +++ b/lib/screen.class.ts @@ -598,7 +598,7 @@ export class ScreenClass { public on(searchInput: FindInput, callback: FindHookCallback): void { this.validateSearchInput("on", searchInput); - const existingHooks = this.findHooks.get(searchInput) || []; + const existingHooks = this.findHooks.get(searchInput) ?? []; this.findHooks.set(searchInput, [...existingHooks, callback]); this.providerRegistry .getLogProvider() diff --git a/package-lock.json b/package-lock.json index a61b8c9a..5b028d9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,12 +42,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -159,26 +159,28 @@ } }, "node_modules/@babel/generator": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", - "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "node_modules/@babel/generator/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@babel/helper-compilation-targets": { @@ -208,39 +210,35 @@ "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -338,21 +336,21 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -391,9 +389,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -452,9 +450,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -658,19 +656,20 @@ } }, "node_modules/@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", - "debug": "^4.1.0", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -678,12 +677,12 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -1498,6 +1497,20 @@ "regenerator-runtime": "^0.13.3" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", @@ -1507,6 +1520,15 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", @@ -3127,14 +3149,24 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001254", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001254.tgz", - "integrity": "sha512-GxeHOvR0LFMYPmFGA+NiTOt9uwYDxB3h154tW2yBYwfz2EMX3i1IBgr6gmJGfU0K8KQsqPa5XqLD8zVdP5lUzA==", + "version": "1.0.30001570", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", + "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] }, "node_modules/chalk": { "version": "4.1.2", @@ -9448,12 +9480,12 @@ }, "dependencies": { "@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "requires": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "dependencies": { @@ -9538,21 +9570,26 @@ } }, "@babel/generator": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", - "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "requires": { - "@babel/types": "^7.15.4", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.6", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } } } }, @@ -9576,33 +9613,29 @@ } } }, - "@babel/helper-function-name": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - } + "@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, - "@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { @@ -9676,18 +9709,18 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true }, "@babel/helper-validator-identifier": { @@ -9714,9 +9747,9 @@ } }, "@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.22.20", @@ -9762,9 +9795,9 @@ } }, "@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -9913,29 +9946,30 @@ } }, "@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", - "debug": "^4.1.0", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } @@ -10550,12 +10584,29 @@ "regenerator-runtime": "^0.13.3" } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/resolve-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, "@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", @@ -11767,9 +11818,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001254", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001254.tgz", - "integrity": "sha512-GxeHOvR0LFMYPmFGA+NiTOt9uwYDxB3h154tW2yBYwfz2EMX3i1IBgr6gmJGfU0K8KQsqPa5XqLD8zVdP5lUzA==", + "version": "1.0.30001570", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", + "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==", "dev": true }, "chalk": { diff --git a/package.json b/package.json index 8290ca72..2f4216d8 100644 --- a/package.json +++ b/package.json @@ -50,9 +50,9 @@ "compile:dev": "npm run clean && tsc -p . --watch", "test": "jest --runInBand", "test:e2e": "npm --prefix e2e/tests cit", - "coverage": "jest --coverage --runInBand", + "coverage": "jest --coverage --runInBand --logHeapUsage", "coverage:clean": "rimraf coverage", - "coverage:merge": "istanbul-merge --out coverage/merged/coverage-final.json ./coverage/unit/coverage-final.json ./coverage/e2e/coverage-final.json", + "coverage:merge": "istanbul-merge --out coverage/merged/coverage-final.json ./coverage/unit/coverage-final.json", "coverage:merge-report": "nyc report --reporter=lcov --reporter=text --temp-dir=./coverage/merged --report-dir=./coverage/merged", "watch": "tsc -w -p .", "publish-next": "npm publish --tag next",