Created by: just-boris
As Jest is based on Jasmine, so it's possible to use Jasmine globals in tests as well.
For example, want to use jasmine.objectContaining
and jasmine.any
declarations in my matchers.
expect(myFunction).toBeCalledWith(
jasmine.objectContaining({prop: 'that is important for me'}),
jasmine.any(Function),
jasmine.any(Object)
);
Currently it works, however, I am getting an error in the editor, that "jasmine" is not defined. (no-undef)
.
According to this @cpojer's comment, Jest is going to support different test runners, so its global list should not be extended by Jasmine. Therefore we need to declare Jasmine environment explicitly