From c671a4374a98caf19f5b227afee190bde5aefd21 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Thu, 8 Feb 2018 20:38:16 +0530 Subject: [PATCH] update test for random hexColorCode --- test/randomHexColorCode/randomHexColorCode.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js index eb2cdba9f..d604bc77e 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -7,6 +7,8 @@ test('Testing randomHexColorCode', (t) => { t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode is a Function'); //t.deepEqual(randomHexColorCode(args..), 'Expected'); t.equal(randomHexColorCode().length, 7); + t.true(randomHexColorCode().startsWith('#'),'The color code starts with "#"'); + t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null) //t.false(randomHexColorCode(args..), 'Expected'); //t.throws(randomHexColorCode(args..), 'Expected'); t.end();