From 5930c0112f9c9154a490851db35247db467db7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Oliva?= Date: Tue, 12 Mar 2019 16:45:58 +0100 Subject: [PATCH] test(oneOf): Add failing tests for contain.oneOf --- package-lock.json | 28 +++++++++++++++++++++------- test/expect.js | 6 ++++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 625239118..26298c86f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2147,12 +2147,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2167,17 +2169,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2294,7 +2299,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2306,6 +2312,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2320,6 +2327,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2327,12 +2335,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2351,6 +2361,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2431,7 +2442,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2443,6 +2455,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2564,6 +2577,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/test/expect.js b/test/expect.js index 9b4f485b8..74313efb8 100644 --- a/test/expect.js +++ b/test/expect.js @@ -3274,6 +3274,12 @@ describe('expect', function () { var threeFour = [3, [4]]; expect(threeFour).to.be.oneOf([1, 2, threeFour]); + expect([1, 2]).to.contain.oneOf([4,2,5]); + expect([3, 4]).to.not.contain.oneOf([2,1,5]); + + expect('The quick brown fox jumps over the lazy dog').to.contain.oneOf(['cat', 'dog', 'bird']); + expect('The quick brown fox jumps over the lazy dog').to.not.contain.oneOf(['elephant', 'pigeon', 'lynx']); + err(function () { expect(1).to.be.oneOf([2, 3], 'blah'); }, "blah: expected 1 to be one of [ 2, 3 ]");