vitest 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chai.d.ts +3 -0
- package/dist/chai.js +11 -0
- package/package.json +1 -1
package/dist/chai.d.ts
CHANGED
|
@@ -8,7 +8,10 @@ declare global {
|
|
|
8
8
|
matchSnapshot(message?: string): Assertion;
|
|
9
9
|
toEqual(expected: any): void;
|
|
10
10
|
toStrictEqual(expected: any): void;
|
|
11
|
+
toBe(expected: any): void;
|
|
11
12
|
toContain(item: any): void;
|
|
13
|
+
toBeTruthy(): void;
|
|
14
|
+
toBeFalsy(): void;
|
|
12
15
|
toBeNaN(): void;
|
|
13
16
|
toBeUndefined(): void;
|
|
14
17
|
toBeNull(): void;
|
package/dist/chai.js
CHANGED
|
@@ -17,9 +17,20 @@ export async function setupChai(config) {
|
|
|
17
17
|
utils.addMethod(proto, 'toStrictEqual', function (expected) {
|
|
18
18
|
return this.equal(expected);
|
|
19
19
|
});
|
|
20
|
+
utils.addMethod(proto, 'toBe', function (expected) {
|
|
21
|
+
return this.be(expected);
|
|
22
|
+
});
|
|
20
23
|
utils.addMethod(proto, 'toContain', function (item) {
|
|
21
24
|
return this.contain(item);
|
|
22
25
|
});
|
|
26
|
+
utils.addMethod(proto, 'toBeTruthy', function () {
|
|
27
|
+
const obj = utils.flag(this, 'object');
|
|
28
|
+
this.assert(Boolean(obj), 'expected #{this} to be truthy', 'expected #{this} to not be truthy', obj);
|
|
29
|
+
});
|
|
30
|
+
utils.addMethod(proto, 'toFalsy', function () {
|
|
31
|
+
const obj = utils.flag(this, 'object');
|
|
32
|
+
this.assert(!obj, 'expected #{this} to be falsy', 'expected #{this} to not be falsy', obj);
|
|
33
|
+
});
|
|
23
34
|
utils.addMethod(proto, 'toBeNaN', function () {
|
|
24
35
|
return this.be.NaN;
|
|
25
36
|
});
|