Compare commits

...

2 Commits

Author SHA1 Message Date
52b8a3f0d1 1.0.11 2022-02-02 08:02:27 +01:00
9213e7905f fix(core): update 2022-02-02 08:02:26 +01:00
4 changed files with 12 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartexpect",
"version": "1.0.10",
"version": "1.0.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartexpect",
"version": "1.0.10",
"version": "1.0.11",
"license": "MIT",
"dependencies": {
"@pushrocks/smartdelay": "^2.0.13",

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartexpect",
"version": "1.0.10",
"version": "1.0.11",
"private": false,
"description": "manage expectations in code",
"main": "dist_ts/index.js",

View File

@ -36,4 +36,12 @@ tap.test('should be greater than', async () => {
smartexpect.expect(4).toBeLessThan(5);
})
tap.test('should correctly determine toContain', async () => {
const hello = {
socool: 'yes'
};
const testArray = [hello];
smartexpect.expect(testArray).toContain(hello);
})
tap.start();

View File

@ -189,9 +189,7 @@ export class Assertion {
return this.runCheck(() => {
const result =
this.baseReference instanceof Array &&
this.baseReference.find((itemArg2) => {
itemArg === itemArg2;
});
this.baseReference.includes(itemArg);
if (!result) {
throw new Error(`${this.baseReference} is not contain ${itemArg}`);
}