Skip to content

Commit 5660ee9

Browse files
Update jest config to only load test files ending with .test.ts/js
Remove dummy tests from test helper/data files in the test repositories, and change the extension of those files from .test.ts to .ts Fix: #1518
1 parent b35cfea commit 5660ee9

File tree

20 files changed

+14
-59
lines changed

20 files changed

+14
-59
lines changed

packages/chaire-lib-common/src/services/routing/ManualRoutingService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import * as RoutingService from './RoutingService';
88
import * as turf from '@turf/turf';
99
import _cloneDeep from 'lodash/cloneDeep';
1010

11+
//TODO: Add tests
12+
1113
/**
1214
* This class provides routing services using manual routing. This mode will always return return results
1315
*/

packages/chaire-lib-common/src/services/routing/__tests__/ManualRoutingService.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
* This file is licensed under the MIT License.
55
* License text available at https://opensource.org/licenses/MIT
66
*/
7-
test('Dummy', () => {
8-
// Dummy test so this file passes, we should have a place to put stub classes
9-
});
7+
8+
test.todo('Manual routing service tests');

packages/chaire-lib-common/src/services/routing/__tests__/OSRMRoutingService.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ test('Table from', async () => {
2525
const response = {query: '', durations: [30, 32.1], distances: [1000, 1004.2]};
2626
const mockTableFrom = jest.fn().mockImplementation((params, callback) => callback(Status.createOk({query: '', durations: [30, 32.1], distances: [1000, 1004.2]})));
2727
eventManager.on('service.osrmRouting.tableFrom', mockTableFrom);
28-
// Dummy test so this file passes, we should have a place to put stub classes
2928
const origin = TestUtils.makePoint([-73, 45]);
3029
const destination1 = TestUtils.makePoint([-73.1, 45.1]);
3130
const destination2 =TestUtils.makePoint([-73.1, 44.9]);
@@ -39,7 +38,6 @@ test('Table to', async () => {
3938
const response = {query: '', durations: [30, 32.1], distances: [1000, 1004.2]};
4039
const mockTableTo = jest.fn().mockImplementation((params, callback) => callback(Status.createOk(response)));
4140
eventManager.on('service.osrmRouting.tableTo', mockTableTo);
42-
// Dummy test so this file passes, we should have a place to put stub classes
4341
const destination = TestUtils.makePoint([-73, 45]);
4442
const origin1 = TestUtils.makePoint([-73.1, 45.1]);
4543
const origin2 =TestUtils.makePoint([-73.1, 44.9]);

packages/chaire-lib-frontend/src/services/__tests__/TransitObjectStub.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,3 @@ export class GenericCollectionStub {
8282
export class TransitNodeStub extends TransitObjectStub {
8383

8484
}
85-
86-
test('Dummy', () => {
87-
// Dummy test so this file passes, we should have a place to put stub classes
88-
});

packages/transition-backend/src/services/simulation/__tests__/SimulationAlgorithmDescriptorStub.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,3 @@ export class SimulationAlgorithmDescriptorStub implements SimulationAlgorithmDes
4646
}
4747

4848
}
49-
50-
51-
test('dummy', () => {
52-
// Just to make this file pass
53-
})

packages/transition-backend/src/services/transitRouting/__tests__/TrRoutingResultStub.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ import { TrRoutingRouteResult } from 'chaire-lib-common/lib/services/transitRout
88
import { RouteResults } from 'chaire-lib-common/lib/services/routing/RoutingService';
99
import { pathNoTransferRouteResult, pathOneTransferRouteResult } from 'chaire-lib-common/lib/test/services/transitRouting/TrRoutingConstantsStubs';
1010

11-
// TODO tahini: this is considered a test file, so we need a test, should be a mock
12-
test('Dummy', () => {
13-
// Dummy test so this file passes, we should have a place to put stub classes
14-
});
15-
1611
// A simple path without transfer
1712
export const simplePathResult: TrRoutingRouteResult = {
1813
totalRoutesCalculated: 1,

packages/transition-common/src/services/__tests__/TransitObjectStub.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,3 @@ export class GenericCollectionStub {
8282
export class TransitNodeStub extends TransitObjectStub {
8383

8484
}
85-
86-
test('Dummy', () => {
87-
// Dummy test so this file passes, we should have a place to put stub classes
88-
});

packages/transition-common/src/services/line/__tests__/Line.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import lineModes from '../../../config/lineModes';
1414
import * as Status from 'chaire-lib-common/lib/utils/Status';
1515

1616
import Line from '../Line';
17-
import { lineAttributesBaseData, lineAttributesMinimalData, lineAttributesWithPathAndSchedule } from './LineData.test';
17+
import { lineAttributesBaseData, lineAttributesMinimalData, lineAttributesWithPathAndSchedule } from './LineData';
1818
import { EventEmitter } from 'events';
1919
import Schedule from '../../schedules/Schedule';
2020

packages/transition-common/src/services/line/__tests__/LineCollection.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import serviceLocator from 'chaire-lib-common/lib/utils/ServiceLocator';
1212

1313
import Line from '../Line';
1414
import LineCollection from '../LineCollection';
15-
import { lineAttributesBaseData, lineAttributesMinimalData } from './LineData.test';
15+
import { lineAttributesBaseData, lineAttributesMinimalData } from './LineData';
1616

1717
// TODO Bring the collection manager to a mocking library
1818
const eventManager = EventManagerMock.eventManagerMock;

packages/transition-common/src/services/line/__tests__/LineData.test.ts renamed to packages/transition-common/src/services/line/__tests__/LineData.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,3 @@ export const lineAttributesWithPathAndSchedule = {
5151
created_at: '2021-07-23T09:59:00.182Z',
5252
updated_at: '2021-07-23T10:17:00.182Z'
5353
} as LineAttributes;
54-
55-
test('Dummy Line', function() {
56-
// Dummy test so this file passes
57-
});

0 commit comments

Comments
 (0)