Compare commits

..

2 Commits

Author SHA1 Message Date
f7cab18412 1.0.5 2022-01-21 17:37:31 +01:00
6f5ceacad2 fix(core): update 2022-01-21 17:37:30 +01:00
5 changed files with 24 additions and 8 deletions

11
package-lock.json generated
View File

@ -1,17 +1,18 @@
{
"name": "@pushrocks/smartexpect",
"version": "1.0.4",
"version": "1.0.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartexpect",
"version": "1.0.4",
"version": "1.0.5",
"license": "MIT",
"dependencies": {
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.6",
"chai": "^4.3.4"
"chai": "^4.3.4",
"fast-deep-equal": "^3.1.3"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
@ -7054,7 +7055,6 @@
"version": "3.1.3",
"resolved": "https://verdaccio.lossless.one/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true,
"license": "MIT"
},
"node_modules/fast-glob": {
@ -21011,8 +21011,7 @@
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://verdaccio.lossless.one/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
},
"fast-glob": {
"version": "2.2.7",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartexpect",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"description": "manage expectations in code",
"main": "dist_ts/index.js",
@ -23,7 +23,8 @@
"dependencies": {
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.6",
"chai": "^4.3.4"
"chai": "^4.3.4",
"fast-deep-equal": "^3.1.3"
},
"browserslist": [
"last 1 chrome versions"

View File

@ -17,4 +17,9 @@ tap.test('async tests', async (toolsArg) => {
await smartexpect.expectAsync(deferred.promise).not.toBeTypeofBoolean();
});
tap.test('should check equality', async () => {
smartexpect.expect('hithere').toEqual('hithere');
smartexpect.expect('hithere').not.toEqual('hithere2');
})
tap.start();

View File

@ -91,4 +91,13 @@ export class Assertion {
}
});
}
public toEqual(comparisonObject: any) {
return this.runCheck(() => {
const result = plugins.fastDeepEqual(this.baseReference, comparisonObject);
if (!result) {
throw new Error(`${this.baseReference} does not equal ${comparisonObject}`);
}
});
}
}

View File

@ -8,7 +8,9 @@ export {
// third party scope
import { expect } from 'chai';
import fastDeepEqual from 'fast-deep-equal';
export {
fastDeepEqual,
expect
}