Skip to content

Commit

Permalink
Replace API standalone functions due to TypeScript update
Browse files Browse the repository at this point in the history
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
  • Loading branch information
natalynyu committed Sep 11, 2020
1 parent 7f51874 commit 984f6b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client/components/pages/__tests__/CourseAdmin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
stub,
SinonStub,
} from 'sinon';
import * as courseAPI from 'client/api/courses';
import { CourseAPI } from 'client/api/courses';
import {
computerScienceCourseResponse,
physicsCourseResponse,
Expand Down Expand Up @@ -58,7 +58,7 @@ describe('Course Admin', function () {
newAreaCourseResponse,
];
beforeEach(function () {
getStub = stub(courseAPI, 'getAllCourses');
getStub = stub(CourseAPI, 'getAllCourses');
getStub.resolves(testData);
dispatchMessage = stub();
});
Expand Down
4 changes: 2 additions & 2 deletions src/client/components/pages/__tests__/FacultyAdmin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
stub,
SinonStub,
} from 'sinon';
import * as facultyAPI from 'client/api/faculty';
import { FacultyAPI } from 'client/api/faculty';
import {
physicsFacultyMemberResponse,
bioengineeringFacultyMemberResponse,
Expand All @@ -30,7 +30,7 @@ describe('Faculty Admin', function () {
newAreaFacultyMemberResponse,
];
beforeEach(function () {
getStub = stub(facultyAPI, 'getAllFacultyMembers');
getStub = stub(FacultyAPI, 'getAllFacultyMembers');
dispatchMessage = stub();
getStub.resolves(testData);
});
Expand Down

0 comments on commit 984f6b6

Please sign in to comment.