From 155270ef7e51a30da7a55781b977c874752204b5 Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Fri, 9 Aug 2024 14:46:36 +0300 Subject: [PATCH] chore: update tests to use ES module chai version (#106) --- package-lock.json | 88 +++++++++++++++++++++++++++++------ package.json | 3 +- src/test/a11y.test.ts | 2 +- src/test/color-picker.test.ts | 2 +- src/test/hex-input.test.ts | 2 +- src/test/utils.test.ts | 2 +- 6 files changed, 81 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35e423f..4d1cdbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "license": "MIT", "devDependencies": { "@custom-elements-manifest/analyzer": "^0.8.4", - "@esm-bundle/chai": "^4.3.4", "@open-wc/testing-helpers": "~2.3.0", "@rollup/plugin-node-resolve": "^15.1.0", "@rollup/plugin-terser": "^0.4.3", "@size-limit/preset-small-lib": "^8.2.6", + "@types/chai": "^4.3.17", "@types/sinon": "^10.0.15", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", @@ -24,6 +24,7 @@ "@web/test-runner": "^0.17.0", "@web/test-runner-commands": "^0.8.0", "@web/test-runner-visual-regression": "^0.8.2", + "chai": "^5.1.1", "csso": "^5.0.5", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", @@ -563,15 +564,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@esm-bundle/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA==", - "dev": true, - "dependencies": { - "@types/chai": "^4.2.12" - } - }, "node_modules/@github/catalyst": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@github/catalyst/-/catalyst-1.6.0.tgz", @@ -1198,9 +1190,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz", - "integrity": "sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==", + "version": "4.3.17", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.17.tgz", + "integrity": "sha512-zmZ21EWzR71B4Sscphjief5djsLre50M6lI622OSySTmn9DB3j+C3kWroHfBQWXbOBwbgg/M8CG/hUxDLIloow==", "dev": true }, "node_modules/@types/co-body": { @@ -2663,6 +2655,15 @@ "node": ">=0.10.0" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/ast-types": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", @@ -2962,6 +2963,22 @@ "node": ">=6" } }, + "node_modules/chai": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "dev": true, + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3061,6 +3078,15 @@ "node": ">=8" } }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "engines": { + "node": ">= 16" + } + }, "node_modules/chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -3809,6 +3835,15 @@ "node": ">=0.10.0" } }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -4977,6 +5012,15 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", @@ -6617,6 +6661,15 @@ "node": ">=8" } }, + "node_modules/loupe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -7555,6 +7608,15 @@ "node": ">=8" } }, + "node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "engines": { + "node": ">= 14.16" + } + }, "node_modules/pause-stream": { "version": "0.0.11", "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", diff --git a/package.json b/package.json index 019921b..92e1ca7 100644 --- a/package.json +++ b/package.json @@ -86,11 +86,11 @@ ], "devDependencies": { "@custom-elements-manifest/analyzer": "^0.8.4", - "@esm-bundle/chai": "^4.3.4", "@open-wc/testing-helpers": "~2.3.0", "@rollup/plugin-node-resolve": "^15.1.0", "@rollup/plugin-terser": "^0.4.3", "@size-limit/preset-small-lib": "^8.2.6", + "@types/chai": "^4.3.17", "@types/sinon": "^10.0.15", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", @@ -100,6 +100,7 @@ "@web/test-runner": "^0.17.0", "@web/test-runner-commands": "^0.8.0", "@web/test-runner-visual-regression": "^0.8.2", + "chai": "^5.1.1", "csso": "^5.0.5", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", diff --git a/src/test/a11y.test.ts b/src/test/a11y.test.ts index d15fe1a..e98123a 100644 --- a/src/test/a11y.test.ts +++ b/src/test/a11y.test.ts @@ -1,4 +1,4 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from 'chai'; import { sendKeys } from '@web/test-runner-commands'; import { fixture, html } from '@open-wc/testing-helpers'; import type { RgbaColorPicker } from '../rgba-color-picker'; diff --git a/src/test/color-picker.test.ts b/src/test/color-picker.test.ts index 5c7aa5e..6c492be 100644 --- a/src/test/color-picker.test.ts +++ b/src/test/color-picker.test.ts @@ -1,4 +1,4 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from 'chai'; import sinon from 'sinon'; import { fixture, html, nextFrame } from '@open-wc/testing-helpers'; import { hsvaToRgbString, rgbaToHsva } from '../lib/utils/convert'; diff --git a/src/test/hex-input.test.ts b/src/test/hex-input.test.ts index 3b1ff2a..a30b78d 100644 --- a/src/test/hex-input.test.ts +++ b/src/test/hex-input.test.ts @@ -1,4 +1,4 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from 'chai'; import { sendKeys } from '@web/test-runner-commands'; import sinon from 'sinon'; import { fixture, html, nextFrame } from '@open-wc/testing-helpers'; diff --git a/src/test/utils.test.ts b/src/test/utils.test.ts index fe35eda..0872a7f 100644 --- a/src/test/utils.test.ts +++ b/src/test/utils.test.ts @@ -1,4 +1,4 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from 'chai'; import { clamp, round } from '../lib/utils/math.js'; import { hexToRgba,