For some reason jasmine's...
expect({}).toEqual([]);
is reporting true (but they are different types). How do I do this check with jasmine?
For some reason jasmine's...
expect({}).toEqual([]);
is reporting true (but they are different types). How do I do this check with jasmine?
You can move the equality check within the expect
clause:
a = {}
b = []
expect(a === b).toBeTruthy();
Have a look at the JasmineMatchers project. It adds matchers like toBeEmptyObject
and toBeArray
and toBeEmptyArray
and many others.