Migrated tests to jest

Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
This commit is contained in:
Angelos Chalaris
2018-06-18 14:18:25 +03:00
parent ae8cd7ee50
commit 5afe81452a
890 changed files with 6950 additions and 6921 deletions

View File

@ -1,26 +0,0 @@
const test = require('tape');
//const functionName = require('./functionName.js');
// Custom override for console.debug to check output.
let output = '';
const console = {};
console.debug = (x) => output = x;
// Override for testing
const functionName = fn => (console.debug(fn.name), fn);
test('Testing functionName', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof functionName === 'function', 'functionName is a Function');
functionName(Math.max);
t.equal(output, 'max', 'Works for native functions');
function fun(x) {return x;}
functionName(fun);
t.equal(output, 'fun', 'Works for functions');
const fn = x => x;
functionName(fn);
t.equal(output, 'fn', 'Works for arrow functions');
//t.deepEqual(functionName(args..), 'Expected');
//t.equal(functionName(args..), 'Expected');
//t.false(functionName(args..), 'Expected');
//t.throws(functionName(args..), 'Expected');
t.end();
});