4

I am using "jasmine":"^2.5.2" and in node, I get error:

 TypeError: jasmine.addMatchers is not a function

when using jasmine-node specfrom terminal running a simple example as below.

What could cause this issue and how to fix it?

   function helloWorld() {
      return "Hello world!";
    }

    describe('keyframes-tool', function () {
        it("says hello", function() {
            expect(helloWorld()).toEqual("Hello world!");
        });
    }); 
GibboK
  • 71,848
  • 143
  • 435
  • 658

1 Answers1

0

This error is probably thrown by an incompatible jasmine-promise-matchers library.

Adding the promise matchers differs between jasmine versions 1 and 2 (and the check of an older version of the promise matcher library fails for jasmine 3).

It should be fixed by updating to a sufficiently new version compatible with the jasmine-core version used (e.g. at least 2.6.0 for version 3 or greater).

Jakob
  • 1
  • 1