ran npm run tdd & generated TDD
This commit is contained in:
4
test/gcd/gcd.js
Normal file
4
test/gcd/gcd.js
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = (...arr) => {
|
||||
const _gcd = (x, y) => (!y ? x : gcd(y, x % y));
|
||||
return [...arr].reduce((a, b) => _gcd(a, b));
|
||||
};
|
||||
13
test/gcd/gcd.test.js
Normal file
13
test/gcd/gcd.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const gcd = require('./gcd.js');
|
||||
|
||||
test('Testing gcd', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof gcd === 'function', 'gcd is a Function');
|
||||
//t.deepEqual(gcd(args..), 'Expected');
|
||||
//t.equal(gcd(args..), 'Expected');
|
||||
//t.false(gcd(args..), 'Expected');
|
||||
//t.throws(gcd(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user