fix(core): update

This commit is contained in:
Philipp Kunz 2022-02-02 08:02:26 +01:00
parent 56fb434f7d
commit 9213e7905f
2 changed files with 9 additions and 3 deletions

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}`);
}