I'm running jasmine-node 3.0.0. When I run the following spec, jasmine reports "TypeError: Cannot read properties of undefined (reading 'returnValue')". Why? Do spy objects in jasmine-node work differently than in jasmine core? If so, how do I configure the return value of a mock method?
describe("CRUD operations", function () {
it("completes successfully", () => {
const mockDao = jasmine.createSpyObj('ProductDao', ['shutdown']);
mockDao.shutdown = jasmine.createSpy('shutdown').and.returnValue(1)
});
});
(In this case, a workaround is mockDao.shutdown = () => 1, but I lose all the other functionality of jasmine spies).
From the jasmine-node page on npmjs.org:
Jasmine 1.3.1 is very old. I think it's simply time to migrate from jasmine-node to jasmine.