Merge pull request #201 from github/typescript-tests

Convert tests to TypeScript
This commit is contained in:
Kristján Oddsson 2022-04-26 12:37:31 +01:00 коммит произвёл GitHub
Родитель 00fc037461 e2623f9035
Коммит aa18d3a5ac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 661 добавлений и 75 удалений

590
package-lock.json сгенерированный
Просмотреть файл

@ -14,6 +14,7 @@
"@open-wc/testing": "^3.1.2",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"@web/dev-server-esbuild": "^0.3.0",
"@web/test-runner": "^0.13.27",
"eslint": "^8.12.0",
"eslint-plugin-github": "^4.3.6",
@ -211,6 +212,12 @@
"integrity": "sha512-nOJARIr3pReqK3hfFCSW2Zg/kFcFsSAlIE7z4a0C9D2dPrgD/YSn3ZP2ET/rxKB65SXyG7jJbkynBRm+tGlacw==",
"dev": true
},
"node_modules/@mdn/browser-compat-data": {
"version": "4.1.17",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-4.1.17.tgz",
"integrity": "sha512-o7hCdjCR5S1beYsOlfwqeXMujqlryV8/nJlM7xmv8HIAb4E4SN/YOE4cwmvZErUkgiVZkApvUDePDnIcxthmAQ==",
"dev": true
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@ -1071,6 +1078,22 @@
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
},
"node_modules/@web/dev-server-esbuild": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@web/dev-server-esbuild/-/dev-server-esbuild-0.3.0.tgz",
"integrity": "sha512-tzkeSwY/VT1/V+ALEwAfeFgx3d1leckKgKGoZn1oPnU1TsBzGUW0czaz7PF3MI96kG+2F2sGp6tchjBm37/70A==",
"dev": true,
"dependencies": {
"@mdn/browser-compat-data": "^4.0.0",
"@web/dev-server-core": "^0.3.17",
"esbuild": "^0.12 || ^0.13 || ^0.14",
"parse5": "^6.0.1",
"ua-parser-js": "^1.0.2"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/@web/dev-server-rollup": {
"version": "0.3.15",
"resolved": "https://registry.npmjs.org/@web/dev-server-rollup/-/dev-server-rollup-0.3.15.tgz",
@ -3008,6 +3031,361 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/esbuild": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.38.tgz",
"integrity": "sha512-12fzJ0fsm7gVZX1YQ1InkOE5f9Tl7cgf6JPYXRJtPIoE0zkWAbHdPHVPPaLi9tYAcEBqheGzqLn/3RdTOyBfcA==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"esbuild-android-64": "0.14.38",
"esbuild-android-arm64": "0.14.38",
"esbuild-darwin-64": "0.14.38",
"esbuild-darwin-arm64": "0.14.38",
"esbuild-freebsd-64": "0.14.38",
"esbuild-freebsd-arm64": "0.14.38",
"esbuild-linux-32": "0.14.38",
"esbuild-linux-64": "0.14.38",
"esbuild-linux-arm": "0.14.38",
"esbuild-linux-arm64": "0.14.38",
"esbuild-linux-mips64le": "0.14.38",
"esbuild-linux-ppc64le": "0.14.38",
"esbuild-linux-riscv64": "0.14.38",
"esbuild-linux-s390x": "0.14.38",
"esbuild-netbsd-64": "0.14.38",
"esbuild-openbsd-64": "0.14.38",
"esbuild-sunos-64": "0.14.38",
"esbuild-windows-32": "0.14.38",
"esbuild-windows-64": "0.14.38",
"esbuild-windows-arm64": "0.14.38"
}
},
"node_modules/esbuild-android-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.38.tgz",
"integrity": "sha512-aRFxR3scRKkbmNuGAK+Gee3+yFxkTJO/cx83Dkyzo4CnQl/2zVSurtG6+G86EQIZ+w+VYngVyK7P3HyTBKu3nw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-android-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.38.tgz",
"integrity": "sha512-L2NgQRWuHFI89IIZIlpAcINy9FvBk6xFVZ7xGdOwIm8VyhX1vNCEqUJO3DPSSy945Gzdg98cxtNt8Grv1CsyhA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.38.tgz",
"integrity": "sha512-5JJvgXkX87Pd1Og0u/NJuO7TSqAikAcQQ74gyJ87bqWRVeouky84ICoV4sN6VV53aTW+NE87qLdGY4QA2S7KNA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-darwin-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.38.tgz",
"integrity": "sha512-eqF+OejMI3mC5Dlo9Kdq/Ilbki9sQBw3QlHW3wjLmsLh+quNfHmGMp3Ly1eWm981iGBMdbtSS9+LRvR2T8B3eQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.38.tgz",
"integrity": "sha512-epnPbhZUt93xV5cgeY36ZxPXDsQeO55DppzsIgWM8vgiG/Rz+qYDLmh5ts3e+Ln1wA9dQ+nZmVHw+RjaW3I5Ig==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-freebsd-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.38.tgz",
"integrity": "sha512-/9icXUYJWherhk+y5fjPI5yNUdFPtXHQlwP7/K/zg8t8lQdHVj20SqU9/udQmeUo5pDFHMYzcEFfJqgOVeKNNQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-32": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.38.tgz",
"integrity": "sha512-QfgfeNHRFvr2XeHFzP8kOZVnal3QvST3A0cgq32ZrHjSMFTdgXhMhmWdKzRXP/PKcfv3e2OW9tT9PpcjNvaq6g==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.38.tgz",
"integrity": "sha512-uuZHNmqcs+Bj1qiW9k/HZU3FtIHmYiuxZ/6Aa+/KHb/pFKr7R3aVqvxlAudYI9Fw3St0VCPfv7QBpUITSmBR1Q==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.38.tgz",
"integrity": "sha512-FiFvQe8J3VKTDXG01JbvoVRXQ0x6UZwyrU4IaLBZeq39Bsbatd94Fuc3F1RGqPF5RbIWW7RvkVQjn79ejzysnA==",
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.38.tgz",
"integrity": "sha512-HlMGZTEsBrXrivr64eZ/EO0NQM8H8DuSENRok9d+Jtvq8hOLzrxfsAT9U94K3KOGk2XgCmkaI2KD8hX7F97lvA==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-mips64le": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.38.tgz",
"integrity": "sha512-qd1dLf2v7QBiI5wwfil9j0HG/5YMFBAmMVmdeokbNAMbcg49p25t6IlJFXAeLzogv1AvgaXRXvgFNhScYEUXGQ==",
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-ppc64le": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.38.tgz",
"integrity": "sha512-mnbEm7o69gTl60jSuK+nn+pRsRHGtDPfzhrqEUXyCl7CTOCLtWN2bhK8bgsdp6J/2NyS/wHBjs1x8aBWwP2X9Q==",
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-riscv64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.38.tgz",
"integrity": "sha512-+p6YKYbuV72uikChRk14FSyNJZ4WfYkffj6Af0/Tw63/6TJX6TnIKE+6D3xtEc7DeDth1fjUOEqm+ApKFXbbVQ==",
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-linux-s390x": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.38.tgz",
"integrity": "sha512-0zUsiDkGJiMHxBQ7JDU8jbaanUY975CdOW1YDrurjrM0vWHfjv9tLQsW9GSyEb/heSK1L5gaweRjzfUVBFoybQ==",
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-netbsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.38.tgz",
"integrity": "sha512-cljBAApVwkpnJZfnRVThpRBGzCi+a+V9Ofb1fVkKhtrPLDYlHLrSYGtmnoTVWDQdU516qYI8+wOgcGZ4XIZh0Q==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-openbsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.38.tgz",
"integrity": "sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-sunos-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.38.tgz",
"integrity": "sha512-2mfIoYW58gKcC3bck0j7lD3RZkqYA7MmujFYmSn9l6TiIcAMpuEvqksO+ntBgbLep/eyjpgdplF7b+4T9VJGOA==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-32": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.38.tgz",
"integrity": "sha512-L2BmEeFZATAvU+FJzJiRLFUP+d9RHN+QXpgaOrs2klshoAm1AE6Us4X6fS9k33Uy5SzScn2TpcgecbqJza1Hjw==",
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.38.tgz",
"integrity": "sha512-Khy4wVmebnzue8aeSXLC+6clo/hRYeNIm0DyikoEqX+3w3rcvrhzpoix0S+MF9vzh6JFskkIGD7Zx47ODJNyCw==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild-windows-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.38.tgz",
"integrity": "sha512-k3FGCNmHBkqdJXuJszdWciAH77PukEyDsdIryEHn9cKLQFxzhT39dSumeTuggaQcXY57UlmLGIkklWZo2qzHpw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
@ -8151,6 +8529,25 @@
"node": ">=8"
}
},
"node_modules/ua-parser-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz",
"integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/ua-parser-js"
},
{
"type": "paypal",
"url": "https://paypal.me/faisalman"
}
],
"engines": {
"node": "*"
}
},
"node_modules/ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
@ -9155,6 +9552,12 @@
"integrity": "sha512-nOJARIr3pReqK3hfFCSW2Zg/kFcFsSAlIE7z4a0C9D2dPrgD/YSn3ZP2ET/rxKB65SXyG7jJbkynBRm+tGlacw==",
"dev": true
},
"@mdn/browser-compat-data": {
"version": "4.1.17",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-4.1.17.tgz",
"integrity": "sha512-o7hCdjCR5S1beYsOlfwqeXMujqlryV8/nJlM7xmv8HIAb4E4SN/YOE4cwmvZErUkgiVZkApvUDePDnIcxthmAQ==",
"dev": true
},
"@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@ -9870,6 +10273,19 @@
}
}
},
"@web/dev-server-esbuild": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@web/dev-server-esbuild/-/dev-server-esbuild-0.3.0.tgz",
"integrity": "sha512-tzkeSwY/VT1/V+ALEwAfeFgx3d1leckKgKGoZn1oPnU1TsBzGUW0czaz7PF3MI96kG+2F2sGp6tchjBm37/70A==",
"dev": true,
"requires": {
"@mdn/browser-compat-data": "^4.0.0",
"@web/dev-server-core": "^0.3.17",
"esbuild": "^0.12 || ^0.13 || ^0.14",
"parse5": "^6.0.1",
"ua-parser-js": "^1.0.2"
}
},
"@web/dev-server-rollup": {
"version": "0.3.15",
"resolved": "https://registry.npmjs.org/@web/dev-server-rollup/-/dev-server-rollup-0.3.15.tgz",
@ -11357,6 +11773,174 @@
"is-symbol": "^1.0.2"
}
},
"esbuild": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.38.tgz",
"integrity": "sha512-12fzJ0fsm7gVZX1YQ1InkOE5f9Tl7cgf6JPYXRJtPIoE0zkWAbHdPHVPPaLi9tYAcEBqheGzqLn/3RdTOyBfcA==",
"dev": true,
"requires": {
"esbuild-android-64": "0.14.38",
"esbuild-android-arm64": "0.14.38",
"esbuild-darwin-64": "0.14.38",
"esbuild-darwin-arm64": "0.14.38",
"esbuild-freebsd-64": "0.14.38",
"esbuild-freebsd-arm64": "0.14.38",
"esbuild-linux-32": "0.14.38",
"esbuild-linux-64": "0.14.38",
"esbuild-linux-arm": "0.14.38",
"esbuild-linux-arm64": "0.14.38",
"esbuild-linux-mips64le": "0.14.38",
"esbuild-linux-ppc64le": "0.14.38",
"esbuild-linux-riscv64": "0.14.38",
"esbuild-linux-s390x": "0.14.38",
"esbuild-netbsd-64": "0.14.38",
"esbuild-openbsd-64": "0.14.38",
"esbuild-sunos-64": "0.14.38",
"esbuild-windows-32": "0.14.38",
"esbuild-windows-64": "0.14.38",
"esbuild-windows-arm64": "0.14.38"
}
},
"esbuild-android-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.38.tgz",
"integrity": "sha512-aRFxR3scRKkbmNuGAK+Gee3+yFxkTJO/cx83Dkyzo4CnQl/2zVSurtG6+G86EQIZ+w+VYngVyK7P3HyTBKu3nw==",
"dev": true,
"optional": true
},
"esbuild-android-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.38.tgz",
"integrity": "sha512-L2NgQRWuHFI89IIZIlpAcINy9FvBk6xFVZ7xGdOwIm8VyhX1vNCEqUJO3DPSSy945Gzdg98cxtNt8Grv1CsyhA==",
"dev": true,
"optional": true
},
"esbuild-darwin-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.38.tgz",
"integrity": "sha512-5JJvgXkX87Pd1Og0u/NJuO7TSqAikAcQQ74gyJ87bqWRVeouky84ICoV4sN6VV53aTW+NE87qLdGY4QA2S7KNA==",
"dev": true,
"optional": true
},
"esbuild-darwin-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.38.tgz",
"integrity": "sha512-eqF+OejMI3mC5Dlo9Kdq/Ilbki9sQBw3QlHW3wjLmsLh+quNfHmGMp3Ly1eWm981iGBMdbtSS9+LRvR2T8B3eQ==",
"dev": true,
"optional": true
},
"esbuild-freebsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.38.tgz",
"integrity": "sha512-epnPbhZUt93xV5cgeY36ZxPXDsQeO55DppzsIgWM8vgiG/Rz+qYDLmh5ts3e+Ln1wA9dQ+nZmVHw+RjaW3I5Ig==",
"dev": true,
"optional": true
},
"esbuild-freebsd-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.38.tgz",
"integrity": "sha512-/9icXUYJWherhk+y5fjPI5yNUdFPtXHQlwP7/K/zg8t8lQdHVj20SqU9/udQmeUo5pDFHMYzcEFfJqgOVeKNNQ==",
"dev": true,
"optional": true
},
"esbuild-linux-32": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.38.tgz",
"integrity": "sha512-QfgfeNHRFvr2XeHFzP8kOZVnal3QvST3A0cgq32ZrHjSMFTdgXhMhmWdKzRXP/PKcfv3e2OW9tT9PpcjNvaq6g==",
"dev": true,
"optional": true
},
"esbuild-linux-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.38.tgz",
"integrity": "sha512-uuZHNmqcs+Bj1qiW9k/HZU3FtIHmYiuxZ/6Aa+/KHb/pFKr7R3aVqvxlAudYI9Fw3St0VCPfv7QBpUITSmBR1Q==",
"dev": true,
"optional": true
},
"esbuild-linux-arm": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.38.tgz",
"integrity": "sha512-FiFvQe8J3VKTDXG01JbvoVRXQ0x6UZwyrU4IaLBZeq39Bsbatd94Fuc3F1RGqPF5RbIWW7RvkVQjn79ejzysnA==",
"dev": true,
"optional": true
},
"esbuild-linux-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.38.tgz",
"integrity": "sha512-HlMGZTEsBrXrivr64eZ/EO0NQM8H8DuSENRok9d+Jtvq8hOLzrxfsAT9U94K3KOGk2XgCmkaI2KD8hX7F97lvA==",
"dev": true,
"optional": true
},
"esbuild-linux-mips64le": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.38.tgz",
"integrity": "sha512-qd1dLf2v7QBiI5wwfil9j0HG/5YMFBAmMVmdeokbNAMbcg49p25t6IlJFXAeLzogv1AvgaXRXvgFNhScYEUXGQ==",
"dev": true,
"optional": true
},
"esbuild-linux-ppc64le": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.38.tgz",
"integrity": "sha512-mnbEm7o69gTl60jSuK+nn+pRsRHGtDPfzhrqEUXyCl7CTOCLtWN2bhK8bgsdp6J/2NyS/wHBjs1x8aBWwP2X9Q==",
"dev": true,
"optional": true
},
"esbuild-linux-riscv64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.38.tgz",
"integrity": "sha512-+p6YKYbuV72uikChRk14FSyNJZ4WfYkffj6Af0/Tw63/6TJX6TnIKE+6D3xtEc7DeDth1fjUOEqm+ApKFXbbVQ==",
"dev": true,
"optional": true
},
"esbuild-linux-s390x": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.38.tgz",
"integrity": "sha512-0zUsiDkGJiMHxBQ7JDU8jbaanUY975CdOW1YDrurjrM0vWHfjv9tLQsW9GSyEb/heSK1L5gaweRjzfUVBFoybQ==",
"dev": true,
"optional": true
},
"esbuild-netbsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.38.tgz",
"integrity": "sha512-cljBAApVwkpnJZfnRVThpRBGzCi+a+V9Ofb1fVkKhtrPLDYlHLrSYGtmnoTVWDQdU516qYI8+wOgcGZ4XIZh0Q==",
"dev": true,
"optional": true
},
"esbuild-openbsd-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.38.tgz",
"integrity": "sha512-CDswYr2PWPGEPpLDUO50mL3WO/07EMjnZDNKpmaxUPsrW+kVM3LoAqr/CE8UbzugpEiflYqJsGPLirThRB18IQ==",
"dev": true,
"optional": true
},
"esbuild-sunos-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.38.tgz",
"integrity": "sha512-2mfIoYW58gKcC3bck0j7lD3RZkqYA7MmujFYmSn9l6TiIcAMpuEvqksO+ntBgbLep/eyjpgdplF7b+4T9VJGOA==",
"dev": true,
"optional": true
},
"esbuild-windows-32": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.38.tgz",
"integrity": "sha512-L2BmEeFZATAvU+FJzJiRLFUP+d9RHN+QXpgaOrs2klshoAm1AE6Us4X6fS9k33Uy5SzScn2TpcgecbqJza1Hjw==",
"dev": true,
"optional": true
},
"esbuild-windows-64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.38.tgz",
"integrity": "sha512-Khy4wVmebnzue8aeSXLC+6clo/hRYeNIm0DyikoEqX+3w3rcvrhzpoix0S+MF9vzh6JFskkIGD7Zx47ODJNyCw==",
"dev": true,
"optional": true
},
"esbuild-windows-arm64": {
"version": "0.14.38",
"resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.38.tgz",
"integrity": "sha512-k3FGCNmHBkqdJXuJszdWciAH77PukEyDsdIryEHn9cKLQFxzhT39dSumeTuggaQcXY57UlmLGIkklWZo2qzHpw==",
"dev": true,
"optional": true
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
@ -15339,6 +15923,12 @@
"integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==",
"dev": true
},
"ua-parser-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz",
"integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==",
"dev": true
},
"ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",

Просмотреть файл

@ -28,7 +28,7 @@
"clean": "tsc --build --clean",
"lint": "eslint . --ignore-path .gitignore",
"pretest": "npm run build && npm run lint",
"test": "web-test-runner test/*.js --node-resolve",
"test": "web-test-runner test/* --node-resolve",
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
},
"prettier": "@github/prettier-config",
@ -38,6 +38,7 @@
"@open-wc/testing": "^3.1.2",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"@web/dev-server-esbuild": "^0.3.0",
"@web/test-runner": "^0.13.27",
"eslint": "^8.12.0",
"eslint-plugin-github": "^4.3.6",

Просмотреть файл

@ -155,13 +155,15 @@ describe('initializeAttrs', () => {
})
describe('attr', () => {
class AttrTestElement extends HTMLElement {}
attr(AttrTestElement.prototype, 'foo')
attr(AttrTestElement.prototype, 'bar')
class AttrTestElement extends HTMLElement {
@attr foo
@attr bar
}
window.customElements.define('attr-test-element', AttrTestElement)
class ExtendedAttrTestElement extends AttrTestElement {}
attr(ExtendedAttrTestElement.prototype, 'baz')
class ExtendedAttrTestElement extends AttrTestElement {
@attr baz
}
window.customElements.define('extended-attr-test-element', ExtendedAttrTestElement)
it('populates the "default" list for initializeAttrs', () => {
@ -214,25 +216,28 @@ describe('defineObservedAttributes', () => {
})
it('will reflect values from attr calls', () => {
class TestElement extends HTMLElement {}
class TestElement extends HTMLElement {
@attr foo
}
defineObservedAttributes(TestElement)
attr(TestElement.prototype, 'foo')
expect(TestElement.observedAttributes).to.eql(['data-foo'])
})
it('will reflect values even if set after definition', () => {
class TestElement extends HTMLElement {}
class TestElement extends HTMLElement {
@attr foo
}
defineObservedAttributes(TestElement)
attr(TestElement.prototype, 'foo')
TestElement.observedAttributes = ['a', 'b', 'c']
expect(TestElement.observedAttributes).to.eql(['data-foo', 'a', 'b', 'c'])
})
it('will reflect values from extended elements', () => {
class TestElement extends HTMLElement {}
class TestElement extends HTMLElement {
@attr foo
}
class ExtendedTestElement extends TestElement {}
defineObservedAttributes(ExtendedTestElement)
attr(TestElement.prototype, 'foo')
expect(ExtendedTestElement.observedAttributes).to.eql(['data-foo'])
})
})

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -16,15 +16,18 @@ describe('controller', () => {
})
it('calls register', async () => {
@controller
class ControllerRegisterElement extends HTMLElement {}
controller(ControllerRegisterElement)
const instance = document.createElement('controller-register')
root.appendChild(instance)
expect(instance).to.be.instanceof(ControllerRegisterElement)
})
it('adds data-catalyst to elements', async () => {
controller(class ControllerDataAttrElement extends HTMLElement {})
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ControllerDataAttrElement extends HTMLElement {}
const instance = document.createElement('controller-data-attr')
root.appendChild(instance)
expect(instance.hasAttribute('data-catalyst')).to.equal(true)
@ -32,20 +35,20 @@ describe('controller', () => {
})
it('binds controllers before custom connectedCallback behaviour', async () => {
controller(
class ControllerBindOrderElement extends HTMLElement {
foo() {
return 'foo'
}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ControllerBindOrderElement extends HTMLElement {
foo() {
return 'foo'
}
)
controller(
class ControllerBindOrderSubElement extends HTMLElement {
connectedCallback() {
this.dispatchEvent(new CustomEvent('loaded'))
}
}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ControllerBindOrderSubElement extends HTMLElement {
connectedCallback() {
this.dispatchEvent(new CustomEvent('loaded'))
}
)
}
const instance = document.createElement('controller-bind-order')
replace(instance, 'foo', fake(instance.foo))
@ -59,20 +62,20 @@ describe('controller', () => {
})
it('binds shadowRoots after connectedCallback behaviour', async () => {
controller(
class ControllerBindShadowElement extends HTMLElement {
connectedCallback() {
this.attachShadow({mode: 'open'})
const button = document.createElement('button')
button.setAttribute('data-action', 'click:controller-bind-shadow#foo')
this.shadowRoot.appendChild(button)
}
foo() {
return 'foo'
}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ControllerBindShadowElement extends HTMLElement {
connectedCallback() {
this.attachShadow({mode: 'open'})
const button = document.createElement('button')
button.setAttribute('data-action', 'click:controller-bind-shadow#foo')
this.shadowRoot.appendChild(button)
}
)
foo() {
return 'foo'
}
}
const instance = document.createElement('controller-bind-shadow')
replace(instance, 'foo', fake(instance.foo))
root.appendChild(instance)
@ -83,13 +86,13 @@ describe('controller', () => {
})
it('binds auto shadowRoots', async () => {
controller(
class ControllerBindAutoShadowElement extends HTMLElement {
foo() {
return 'foo'
}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ControllerBindAutoShadowElement extends HTMLElement {
foo() {
return 'foo'
}
)
}
const instance = document.createElement('controller-bind-auto-shadow')
const template = document.createElement('template')
template.setAttribute('data-shadowroot', 'open')
@ -108,15 +111,17 @@ describe('controller', () => {
})
it('upgrades child decendants when connected', () => {
controller(class ChildElementElement extends HTMLElement {})
controller(
class ParentElementElement extends HTMLElement {
connectedCallback() {
const child = this.querySelector('child-element')
expect(child.matches(':defined')).to.equal(true)
}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ChildElementElement extends HTMLElement {}
@controller
// eslint-disable-next-line @typescript-eslint/no-unused-vars
class ParentElementElement extends HTMLElement {
connectedCallback() {
const child = this.querySelector('child-element')
expect(child.matches(':defined')).to.equal(true)
}
)
}
// eslint-disable-next-line github/unescaped-html-literal
root.innerHTML = '<parent-element><child-element></child-element></parent-element>'
@ -124,6 +129,7 @@ describe('controller', () => {
describe('attrs', () => {
let attrValues = []
@controller
class AttributeTestElement extends HTMLElement {
foo = 'baz'
attributeChangedCallback() {
@ -131,7 +137,6 @@ describe('controller', () => {
attrValues.push(this.foo)
}
}
controller(AttributeTestElement)
attr(AttributeTestElement.prototype, 'foo')
beforeEach(() => {

Просмотреть файл

Просмотреть файл

@ -1,21 +0,0 @@
/* eslint-disable-next-line @typescript-eslint/no-var-requires */
process.env.CHROME_BIN = require('chromium').path
module.exports = function (config) {
config.set({
basePath: '..',
frameworks: ['mocha', 'chai-spies', 'chai'],
files: [
{pattern: 'lib/*.js', type: 'module', included: false},
{pattern: 'test/*', type: 'module', included: true}
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
autoWatch: false,
singleRun: true,
concurrency: Infinity
})
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,6 @@
import {esbuildPlugin} from '@web/dev-server-esbuild'
export default {
files: ['test/*'],
plugins: [esbuildPlugin({ts: true})]
}