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:
8
test2/fibonacciUntilNum/fibonacciUntilNum.js
Normal file
8
test2/fibonacciUntilNum/fibonacciUntilNum.js
Normal file
@ -0,0 +1,8 @@
|
||||
const fibonacciUntilNum = num => {
|
||||
let n = Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));
|
||||
return Array.from({ length: n }).reduce(
|
||||
(acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),
|
||||
[]
|
||||
);
|
||||
};
|
||||
module.exports = fibonacciUntilNum;
|
||||
8
test2/fibonacciUntilNum/fibonacciUntilNum.test.js
Normal file
8
test2/fibonacciUntilNum/fibonacciUntilNum.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
const expect = require('expect');
|
||||
const fibonacciUntilNum = require('./fibonacciUntilNum.js');
|
||||
|
||||
test('Testing fibonacciUntilNum', () => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
expect(typeof fibonacciUntilNum === 'function').toBeTruthy();
|
||||
});
|
||||
Reference in New Issue
Block a user