UNPKG

harvest

Version:
30 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const projectAssignments_1 = require("./projectAssignments"); const harvest = { request: () => { console.log('Request Made'); } }; describe('ProjectAssignments test', () => { let instance; let request; let id = 1000; beforeEach(() => { instance = new projectAssignments_1.ProjectAssignmentsAPI(harvest); request = spyOn(instance.harvest, 'request'); }); it('ProjectAssignments is instantiable', () => { expect(instance).toBeInstanceOf(projectAssignments_1.ProjectAssignmentsAPI); }); it('should have a list method that calls the request method', () => { const query = { is_active: true }; instance.list(id, query); expect(request).toBeCalledWith('GET', '/v2/users/1000/project_assignments', query); }); it('should have a me method that calls the request method', () => { instance.me(); expect(request).toBeCalledWith('GET', '/v2/users/me/project_assignments', {}); }); }); //# sourceMappingURL=projectAssignments.spec.js.map