1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: Add TS support to code coverage

This commit is contained in:
Clint Checketts 2021-02-16 09:09:42 -07:00
parent 94b278a887
commit d1933bcd1b
4 changed files with 159 additions and 4 deletions

4
.nycrc Normal file
View File

@ -0,0 +1,4 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true
}

View File

@ -63,6 +63,7 @@
"snapshotDir": "snapshots" "snapshotDir": "snapshots"
}, },
"dependencies": { "dependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.15.1", "@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1", "@typescript-eslint/parser": "^4.15.1",
"async": "^3.1.0", "async": "^3.1.0",
@ -99,6 +100,8 @@
"serve-favicon": "^2.5.0", "serve-favicon": "^2.5.0",
"unleash-frontend": "3.12.0", "unleash-frontend": "3.12.0",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"source-map-support": "^0.5.19",
"ts-node": "^9.1.1",
"yargs": "^16.0.3" "yargs": "^16.0.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,5 +1,5 @@
class FeatureHasTagError extends Error { class FeatureHasTagError extends Error {
constructor(message) { constructor(message: string) {
super(); super();
Error.captureStackTrace(this, this.constructor); Error.captureStackTrace(this, this.constructor);
@ -7,7 +7,7 @@ class FeatureHasTagError extends Error {
this.message = message; this.message = message;
} }
toJSON() { toJSON(): any {
const obj = { const obj = {
isJoi: true, isJoi: true,
name: this.constructor.name, name: this.constructor.name,
@ -21,4 +21,4 @@ class FeatureHasTagError extends Error {
} }
} }
export {FeatureHasTagError}; export default { FeatureHasTagError };

150
yarn.lock
View File

@ -378,6 +378,13 @@
js-yaml "^3.13.1" js-yaml "^3.13.1"
resolve-from "^5.0.0" resolve-from "^5.0.0"
"@istanbuljs/nyc-config-typescript@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz#55172f5663b3635586add21b14d42ca94a163d58"
integrity sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==
dependencies:
"@istanbuljs/schema" "^0.1.2"
"@istanbuljs/schema@^0.1.2": "@istanbuljs/schema@^0.1.2":
version "0.1.2" version "0.1.2"
resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz" resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz"
@ -515,6 +522,11 @@
"@types/minimatch" "*" "@types/minimatch" "*"
"@types/node" "*" "@types/node" "*"
"@types/json-schema@^7.0.3":
version "7.0.7"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
"@types/json5@^0.0.29": "@types/json5@^0.0.29":
version "0.0.29" version "0.0.29"
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz"
@ -563,6 +575,76 @@
"@types/mime" "^1" "@types/mime" "^1"
"@types/node" "*" "@types/node" "*"
"@typescript-eslint/eslint-plugin@^4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.1.tgz#835f64aa0a403e5e9e64c10ceaf8d05c3f015180"
integrity sha512-yW2epMYZSpNJXZy22Biu+fLdTG8Mn6b22kR3TqblVk50HGNV8Zya15WAXuQCr8tKw4Qf1BL4QtI6kv6PCkLoJw==
dependencies:
"@typescript-eslint/experimental-utils" "4.15.1"
"@typescript-eslint/scope-manager" "4.15.1"
debug "^4.1.1"
functional-red-black-tree "^1.0.1"
lodash "^4.17.15"
regexpp "^3.0.0"
semver "^7.3.2"
tsutils "^3.17.1"
"@typescript-eslint/experimental-utils@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.1.tgz#d744d1ac40570a84b447f7aa1b526368afd17eec"
integrity sha512-9LQRmOzBRI1iOdJorr4jEnQhadxK4c9R2aEAsm7WE/7dq8wkKD1suaV0S/JucTL8QlYUPU1y2yjqg+aGC0IQBQ==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/scope-manager" "4.15.1"
"@typescript-eslint/types" "4.15.1"
"@typescript-eslint/typescript-estree" "4.15.1"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"
"@typescript-eslint/parser@^4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.1.tgz#4c91a0602733db63507e1dbf13187d6c71a153c4"
integrity sha512-V8eXYxNJ9QmXi5ETDguB7O9diAXlIyS+e3xzLoP/oVE4WCAjssxLIa0mqCLsCGXulYJUfT+GV70Jv1vHsdKwtA==
dependencies:
"@typescript-eslint/scope-manager" "4.15.1"
"@typescript-eslint/types" "4.15.1"
"@typescript-eslint/typescript-estree" "4.15.1"
debug "^4.1.1"
"@typescript-eslint/scope-manager@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.15.1.tgz#f6511eb38def2a8a6be600c530c243bbb56ac135"
integrity sha512-ibQrTFcAm7yG4C1iwpIYK7vDnFg+fKaZVfvyOm3sNsGAerKfwPVFtYft5EbjzByDJ4dj1WD8/34REJfw/9wdVA==
dependencies:
"@typescript-eslint/types" "4.15.1"
"@typescript-eslint/visitor-keys" "4.15.1"
"@typescript-eslint/types@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.1.tgz#da702f544ef1afae4bc98da699eaecd49cf31c8c"
integrity sha512-iGsaUyWFyLz0mHfXhX4zO6P7O3sExQpBJ2dgXB0G5g/8PRVfBBsmQIc3r83ranEQTALLR3Vko/fnCIVqmH+mPw==
"@typescript-eslint/typescript-estree@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.1.tgz#fa9a9ff88b4a04d901ddbe5b248bc0a00cd610be"
integrity sha512-z8MN3CicTEumrWAEB2e2CcoZa3KP9+SMYLIA2aM49XW3cWIaiVSOAGq30ffR5XHxRirqE90fgLw3e6WmNx5uNw==
dependencies:
"@typescript-eslint/types" "4.15.1"
"@typescript-eslint/visitor-keys" "4.15.1"
debug "^4.1.1"
globby "^11.0.1"
is-glob "^4.0.1"
semver "^7.3.2"
tsutils "^3.17.1"
"@typescript-eslint/visitor-keys@4.15.1":
version "4.15.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.1.tgz#c76abbf2a3be8a70ed760f0e5756bf62de5865dd"
integrity sha512-tYzaTP9plooRJY8eNlpAewTOqtWW/4ff/5wBjNVaJ0S0wC4Gpq/zDVRTJa5bq2v1pCNQ08xxMCndcvR+h7lMww==
dependencies:
"@typescript-eslint/types" "4.15.1"
eslint-visitor-keys "^2.0.0"
abort-controller@^3.0.0: abort-controller@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz"
@ -692,6 +774,11 @@ archy@^1.0.0:
resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz"
integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
argparse@^1.0.7: argparse@^1.0.7:
version "1.0.10" version "1.0.10"
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
@ -1520,6 +1607,11 @@ coveralls@^3.1.0:
minimist "^1.2.5" minimist "^1.2.5"
request "^2.88.2" request "^2.88.2"
create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
cross-spawn@^6.0.5: cross-spawn@^6.0.5:
version "6.0.5" version "6.0.5"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz"
@ -1809,6 +1901,11 @@ dicer@0.2.5:
readable-stream "1.1.x" readable-stream "1.1.x"
streamsearch "0.1.2" streamsearch "0.1.2"
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
dir-glob@^3.0.1: dir-glob@^3.0.1:
version "3.0.1" version "3.0.1"
resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz"
@ -2109,11 +2206,23 @@ eslint-utils@^1.4.3:
dependencies: dependencies:
eslint-visitor-keys "^1.1.0" eslint-visitor-keys "^1.1.0"
eslint-utils@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
dependencies:
eslint-visitor-keys "^1.1.0"
eslint-visitor-keys@^1.1.0: eslint-visitor-keys@^1.1.0:
version "1.3.0" version "1.3.0"
resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz"
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
eslint-visitor-keys@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8"
integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==
eslint@^6.8.0: eslint@^6.8.0:
version "6.8.0" version "6.8.0"
resolved "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz" resolved "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz"
@ -3994,6 +4103,11 @@ make-dir@^3.0.0, make-dir@^3.0.2:
dependencies: dependencies:
semver "^6.0.0" semver "^6.0.0"
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
make-iterator@^1.0.0: make-iterator@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz" resolved "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz"
@ -5188,6 +5302,11 @@ regexpp@^2.0.1:
resolved "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz" resolved "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz"
integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==
regexpp@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==
registry-auth-token@^4.0.0: registry-auth-token@^4.0.0:
version "4.2.0" version "4.2.0"
resolved "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz" resolved "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz"
@ -5609,7 +5728,7 @@ source-map-resolve@^0.5.0:
source-map-url "^0.4.0" source-map-url "^0.4.0"
urix "^0.1.0" urix "^0.1.0"
source-map-support@^0.5.19: source-map-support@^0.5.17, source-map-support@^0.5.19:
version "0.5.19" version "0.5.19"
resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
@ -6084,6 +6203,18 @@ trim-off-newlines@^1.0.1:
resolved "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz" resolved "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz"
integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM=
ts-node@^9.1.1:
version "9.1.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d"
integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==
dependencies:
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
tsc-watch@^4.2.9: tsc-watch@^4.2.9:
version "4.2.9" version "4.2.9"
resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-4.2.9.tgz#d93fc74233ca4ef7ee6b12d08c0fe6aca3e19044" resolved "https://registry.yarnpkg.com/tsc-watch/-/tsc-watch-4.2.9.tgz#d93fc74233ca4ef7ee6b12d08c0fe6aca3e19044"
@ -6105,6 +6236,11 @@ tsconfig-paths@^3.9.0:
minimist "^1.2.0" minimist "^1.2.0"
strip-bom "^3.0.0" strip-bom "^3.0.0"
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^1.9.0: tslib@^1.9.0:
version "1.13.0" version "1.13.0"
resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz" resolved "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz"
@ -6115,6 +6251,13 @@ tsscmp@1.0.6:
resolved "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz" resolved "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz"
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==
tsutils@^3.17.1:
version "3.20.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.20.0.tgz#ea03ea45462e146b53d70ce0893de453ff24f698"
integrity sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==
dependencies:
tslib "^1.8.1"
tunnel-agent@^0.6.0: tunnel-agent@^0.6.0:
version "0.6.0" version "0.6.0"
resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
@ -6561,3 +6704,8 @@ yargs@^16.0.3:
string-width "^4.2.0" string-width "^4.2.0"
y18n "^5.0.1" y18n "^5.0.1"
yargs-parser "^20.0.0" yargs-parser "^20.0.0"
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==