Test migration to jest by hand

Apparently using regular expressions is way easier.
This commit is contained in:
Angelos Chalaris
2018-06-18 15:15:56 +03:00
parent 5df7098fac
commit a78f5db260
894 changed files with 5917 additions and 3607 deletions

6
test/isPrime/isPrime.js Normal file
View File

@ -0,0 +1,6 @@
const isPrime = num => {
const boundary = Math.floor(Math.sqrt(num));
for (var i = 2; i <= boundary; i++) if (num % i === 0) return false;
return num >= 2;
};
module.exports = isPrime;

View File

@ -0,0 +1,9 @@
const expect = require('expect');
const isPrime = require('./isPrime.js');
test('isPrime is a Function', () => {
expect(isPrime).toBeInstanceOf(Function);
});
t.equal(isPrime(11), true, "passed number is a prime");