1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 | const assert = require("assert");
|
20 | const mocha_1 = require("mocha");
|
21 | const egoose = require("../index");
|
22 | const EGO_DIGITAL = {
|
23 | lat: 50.782131,
|
24 | lng: 6.047182
|
25 | };
|
26 | const EGO_FACTORY_1 = {
|
27 | lat: 50.775635,
|
28 | lng: 6.132818,
|
29 | };
|
30 | mocha_1.describe('#calcDistance', function () {
|
31 | mocha_1.describe('route #1', function () {
|
32 | mocha_1.it('should return', async function () {
|
33 | const DISTANCE = egoose.calcDistance(EGO_DIGITAL.lat, EGO_DIGITAL.lng, EGO_FACTORY_1.lat, EGO_FACTORY_1.lng);
|
34 | assert.ok(typeof DISTANCE === 'number');
|
35 | const ACTUAL = parseInt('' + (Math.floor(DISTANCE / 1000.0) * 1000));
|
36 | assert.equal(ACTUAL, 6000);
|
37 | assert.strictEqual(ACTUAL, 6000);
|
38 | });
|
39 | });
|
40 | mocha_1.describe('route #2', function () {
|
41 | mocha_1.it('should return a random string', function () {
|
42 | const DISTANCE = egoose.calcDistance(EGO_FACTORY_1.lat, EGO_FACTORY_1.lng, EGO_DIGITAL.lat, EGO_DIGITAL.lng);
|
43 | assert.ok(typeof DISTANCE === 'number');
|
44 | const ACTUAL = parseInt('' + (Math.floor(DISTANCE / 1000.0) * 1000));
|
45 | assert.equal(ACTUAL, 6000);
|
46 | assert.strictEqual(ACTUAL, 6000);
|
47 | });
|
48 | });
|
49 | });
|
50 |
|
\ | No newline at end of file |