Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
2
test/distance/distance.js
Normal file
2
test/distance/distance.js
Normal file
@ -0,0 +1,2 @@
|
||||
const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
|
||||
module.exports = distance;
|
||||
12
test/distance/distance.test.js
Normal file
12
test/distance/distance.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
const expect = require('expect');
|
||||
const distance = require('./distance.js');
|
||||
|
||||
|
||||
test('distance is a Function', () => {
|
||||
expect(distance).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Calculates the distance between two points', () => {
|
||||
expect(distance(1, 1, 2, 3), 2.23606797749979).toBe()
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user