ran npm run tdd & generated TDD

This commit is contained in:
King
2018-01-09 06:09:49 -05:00
parent e025853161
commit 4cecb85eb7
386 changed files with 3275 additions and 0 deletions

16
test/runAsync/runAsync.js Normal file
View File

@ -0,0 +1,16 @@
module.exports = fn => {
const blob = `var fn = ${fn.toString()}; postMessage(fn());`;
const worker = new Worker(
URL.createObjectURL(new Blob([blob]), {
type: 'application/javascript; charset=utf-8'
})
);
return new Promise((res, rej) => {
worker.onmessage = ({ data }) => {
res(data), worker.terminate();
};
worker.onerror = err => {
rej(err), worker.terminate();
};
});
};

View File

@ -0,0 +1,13 @@
const test = require('tape');
const runAsync = require('./runAsync.js');
test('Testing runAsync', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof runAsync === 'function', 'runAsync is a Function');
//t.deepEqual(runAsync(args..), 'Expected');
//t.equal(runAsync(args..), 'Expected');
//t.false(runAsync(args..), 'Expected');
//t.throws(runAsync(args..), 'Expected');
t.end();
});