Merge branch 'master' of github.com:Chalarangelo/30-seconds-of-code
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
const randomHexColorCode = () => {
|
||||
let n = ((Math.random() * 0xfffff) | 0).toString(16);
|
||||
return '#' + (n.length !== 6 ? ((Math.random() * 0xf) | 0).toString(16) + n : n);
|
||||
let n = (Math.random() * 0xfffff * 1000000).toString(16);
|
||||
return '#' + n.slice(0, 6);
|
||||
};
|
||||
module.exports = randomHexColorCode
|
||||
@ -1,4 +1,4 @@
|
||||
Test log for: Sun Jan 28 2018 20:14:47 GMT+0000 (UTC)
|
||||
Test log for: Tue Jan 30 2018 20:16:22 GMT+0000 (UTC)
|
||||
|
||||
> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code
|
||||
> tape test/**/*.test.js | tap-spec
|
||||
@ -1108,6 +1108,7 @@ Test log for: Sun Jan 28 2018 20:14:47 GMT+0000 (UTC)
|
||||
Testing randomHexColorCode
|
||||
|
||||
✔ randomHexColorCode is a Function
|
||||
✔ should be equal
|
||||
|
||||
Testing randomIntArrayInRange
|
||||
|
||||
@ -1608,8 +1609,8 @@ Test log for: Sun Jan 28 2018 20:14:47 GMT+0000 (UTC)
|
||||
✔ Works with multiple promises
|
||||
|
||||
|
||||
total: 721
|
||||
passing: 721
|
||||
duration: 3.2s
|
||||
total: 722
|
||||
passing: 722
|
||||
duration: 2.9s
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user