Skip to content

Commit fbe16e2

Browse files
committed
Replace API standalone functions due to TypeScript update
It turns out that you can no longer stub free-standing functions in Typescript 3.9.2+ according to this issue: microsoft/TypeScript#38568 sinonjs/sinon#562
1 parent 70a686b commit fbe16e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/client/components/pages/__tests__/CourseAdmin.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
stub,
1717
SinonStub,
1818
} from 'sinon';
19-
import * as courseAPI from 'client/api/courses';
19+
import { CourseAPI } from 'client/api/courses';
2020
import {
2121
computerScienceCourseResponse,
2222
physicsCourseResponse,
@@ -58,7 +58,7 @@ describe('Course Admin', function () {
5858
newAreaCourseResponse,
5959
];
6060
beforeEach(function () {
61-
getStub = stub(courseAPI, 'getAllCourses');
61+
getStub = stub(CourseAPI, 'getAllCourses');
6262
getStub.resolves(testData);
6363
dispatchMessage = stub();
6464
});

src/client/components/pages/__tests__/FacultyAdmin.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
stub,
1111
SinonStub,
1212
} from 'sinon';
13-
import * as facultyAPI from 'client/api/faculty';
13+
import { FacultyAPI } from 'client/api/faculty';
1414
import {
1515
physicsFacultyMemberResponse,
1616
bioengineeringFacultyMemberResponse,
@@ -30,7 +30,7 @@ describe('Faculty Admin', function () {
3030
newAreaFacultyMemberResponse,
3131
];
3232
beforeEach(function () {
33-
getStub = stub(facultyAPI, 'getAllFacultyMembers');
33+
getStub = stub(FacultyAPI, 'getAllFacultyMembers');
3434
dispatchMessage = stub();
3535
getStub.resolves(testData);
3636
});

0 commit comments

Comments
 (0)