Commit 42dc3f2b authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Add chai and sinon types to get better IDE code intellisense

parent 09f0bcaf
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"@sentry/browser": "^7.1.1", "@sentry/browser": "^7.1.1",
"@sentry/cli": "^2.0.2", "@sentry/cli": "^2.0.2",
"@trivago/prettier-plugin-sort-imports": "^4.1.1", "@trivago/prettier-plugin-sort-imports": "^4.1.1",
"@types/chai": "^4.3.12",
"@types/dompurify": "^3.0.0", "@types/dompurify": "^3.0.0",
"@types/escape-html": "^1.0.1", "@types/escape-html": "^1.0.1",
"@types/hammerjs": "^2.0.41", "@types/hammerjs": "^2.0.41",
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
"@types/scroll-into-view": "^1.16.0", "@types/scroll-into-view": "^1.16.0",
"@types/shallowequal": "^1.1.1", "@types/shallowequal": "^1.1.1",
"@types/showdown": "^2.0.0", "@types/showdown": "^2.0.0",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1", "@typescript-eslint/parser": "^7.0.1",
"approx-string-match": "^2.0.0", "approx-string-match": "^2.0.0",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* e.g. await rejects(someAsyncFunction(), /expected error/g); * e.g. await rejects(someAsyncFunction(), /expected error/g);
* *
* @param {Promise} promiseResult - The returned promise a function to test * @param {Promise} promiseResult - The returned promise a function to test
* @param {RegEx|String} errorMessage - A string or regex that matches the error * @param {RegExp|string} errorMessage - A string or regex that matches the error
* which is expected to be thrown. * which is expected to be thrown.
*/ */
......
import type { assert as chaiAssert } from 'chai';
import type { assert as sinonAssert } from 'sinon';
// This represents the type of the rejects function from
// src/test-utils/assert-methods.js
// Defined here as a local type to avoid a dependency with that module
type Rejects = <T>(
promiseResult: Promise<T>,
errorMessage: RegExp | string,
) => Promise<T>;
// During tests bootstrap, we expose chai's assert as a global and merge it with
// sinon's one.
declare global {
const assert: typeof chaiAssert & typeof sinonAssert & { rejects: Rejects };
}
...@@ -4457,6 +4457,13 @@ __metadata: ...@@ -4457,6 +4457,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/chai@npm:^4.3.12":
version: 4.3.12
resolution: "@types/chai@npm:4.3.12"
checksum: 64e9354181046bfc78f527bba006f2e58b49efb702a501bdd1faec51e21e4d2248e7fb49843fd3f2189e3bf3680480b94e8a1ab6d097e67183bdeacd6d024ed6
languageName: node
linkType: hard
"@types/cookie@npm:^0.4.1": "@types/cookie@npm:^0.4.1":
version: 0.4.1 version: 0.4.1
resolution: "@types/cookie@npm:0.4.1" resolution: "@types/cookie@npm:0.4.1"
...@@ -4592,6 +4599,22 @@ __metadata: ...@@ -4592,6 +4599,22 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/sinon@npm:^17.0.3":
version: 17.0.3
resolution: "@types/sinon@npm:17.0.3"
dependencies:
"@types/sinonjs__fake-timers": "*"
checksum: c8e9956d9c90fe1ec1cc43085ae48897f93f9ea86e909ab47f255ea71f5229651faa070393950fb6923aef426c84e92b375503f9f8886ef44668b82a8ee49e9a
languageName: node
linkType: hard
"@types/sinonjs__fake-timers@npm:*":
version: 8.1.5
resolution: "@types/sinonjs__fake-timers@npm:8.1.5"
checksum: 7e3c08f6c13df44f3ea7d9a5155ddf77e3f7314c156fa1c5a829a4f3763bafe2f75b1283b887f06e6b4296996a2f299b70f64ff82625f9af5885436e2524d10c
languageName: node
linkType: hard
"@types/trusted-types@npm:*": "@types/trusted-types@npm:*":
version: 2.0.2 version: 2.0.2
resolution: "@types/trusted-types@npm:2.0.2" resolution: "@types/trusted-types@npm:2.0.2"
...@@ -9189,6 +9212,7 @@ __metadata: ...@@ -9189,6 +9212,7 @@ __metadata:
"@sentry/browser": ^7.1.1 "@sentry/browser": ^7.1.1
"@sentry/cli": ^2.0.2 "@sentry/cli": ^2.0.2
"@trivago/prettier-plugin-sort-imports": ^4.1.1 "@trivago/prettier-plugin-sort-imports": ^4.1.1
"@types/chai": ^4.3.12
"@types/dompurify": ^3.0.0 "@types/dompurify": ^3.0.0
"@types/escape-html": ^1.0.1 "@types/escape-html": ^1.0.1
"@types/hammerjs": ^2.0.41 "@types/hammerjs": ^2.0.41
...@@ -9197,6 +9221,7 @@ __metadata: ...@@ -9197,6 +9221,7 @@ __metadata:
"@types/scroll-into-view": ^1.16.0 "@types/scroll-into-view": ^1.16.0
"@types/shallowequal": ^1.1.1 "@types/shallowequal": ^1.1.1
"@types/showdown": ^2.0.0 "@types/showdown": ^2.0.0
"@types/sinon": ^17.0.3
"@typescript-eslint/eslint-plugin": ^7.0.1 "@typescript-eslint/eslint-plugin": ^7.0.1
"@typescript-eslint/parser": ^7.0.1 "@typescript-eslint/parser": ^7.0.1
approx-string-match: ^2.0.0 approx-string-match: ^2.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment