Travis build: 1297 [cron]
This commit is contained in:
9
test/hashBrowser/hashBrowser.js
Normal file
9
test/hashBrowser/hashBrowser.js
Normal file
@ -0,0 +1,9 @@
|
||||
const hashBrowser = val =>
|
||||
crypto.subtle.digest('SHA-256', new TextEncoder('utf-8').encode(val)).then(h => {
|
||||
let hexes = [],
|
||||
view = new DataView(h);
|
||||
for (let i = 0; i < view.byteLength; i += 4)
|
||||
hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8));
|
||||
return hexes.join('');
|
||||
});
|
||||
module.exports = hashBrowser
|
||||
13
test/hashBrowser/hashBrowser.test.js
Normal file
13
test/hashBrowser/hashBrowser.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const hashBrowser = require('./hashBrowser.js');
|
||||
|
||||
test('Testing hashBrowser', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
|
||||
//t.deepEqual(hashBrowser(args..), 'Expected');
|
||||
//t.equal(hashBrowser(args..), 'Expected');
|
||||
//t.false(hashBrowser(args..), 'Expected');
|
||||
//t.throws(hashBrowser(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
15
test/hashNode/hashNode.js
Normal file
15
test/hashNode/hashNode.js
Normal file
@ -0,0 +1,15 @@
|
||||
const crypto = require('crypto');
|
||||
const hashNode = val =>
|
||||
new Promise(resolve =>
|
||||
setTimeout(
|
||||
() =>
|
||||
resolve(
|
||||
crypto
|
||||
.createHash('sha256')
|
||||
.update(val)
|
||||
.digest('hex')
|
||||
),
|
||||
0
|
||||
)
|
||||
);
|
||||
module.exports = hashNode
|
||||
13
test/hashNode/hashNode.test.js
Normal file
13
test/hashNode/hashNode.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const hashNode = require('./hashNode.js');
|
||||
|
||||
test('Testing hashNode', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof hashNode === 'function', 'hashNode is a Function');
|
||||
//t.deepEqual(hashNode(args..), 'Expected');
|
||||
//t.equal(hashNode(args..), 'Expected');
|
||||
//t.false(hashNode(args..), 'Expected');
|
||||
//t.throws(hashNode(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2
test/is/is.js
Normal file
2
test/is/is.js
Normal file
@ -0,0 +1,2 @@
|
||||
const is = (type, val) => val instanceof type;
|
||||
module.exports = is
|
||||
13
test/is/is.test.js
Normal file
13
test/is/is.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const is = require('./is.js');
|
||||
|
||||
test('Testing is', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof is === 'function', 'is is a Function');
|
||||
//t.deepEqual(is(args..), 'Expected');
|
||||
//t.equal(is(args..), 'Expected');
|
||||
//t.false(is(args..), 'Expected');
|
||||
//t.throws(is(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2432
test/testlog
2432
test/testlog
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user