Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
5
test/isArmstrongNumber/isArmstrongNumber.js
Normal file
5
test/isArmstrongNumber/isArmstrongNumber.js
Normal file
@ -0,0 +1,5 @@
|
||||
const isArmstrongNumber = digits =>
|
||||
(arr => arr.reduce((a, d) => a + parseInt(d) ** arr.length, 0) == digits)(
|
||||
(digits + '').split('')
|
||||
);
|
||||
module.exports = isArmstrongNumber;
|
||||
8
test/isArmstrongNumber/isArmstrongNumber.test.js
Normal file
8
test/isArmstrongNumber/isArmstrongNumber.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
const expect = require('expect');
|
||||
const isArmstrongNumber = require('./isArmstrongNumber.js');
|
||||
|
||||
|
||||
test('isArmstrongNumber is a Function', () => {
|
||||
expect(isArmstrongNumber).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user