jasmine-equal-value
v1.0.7
Published
This package extends the global matchers to include **toEqualValue**. Allows you to expect deep value equality. It uses **isEquals** from lodash, but ignores function and prototype checking.
Downloads
4
Readme
Jasmine Deep Value Equal
This package extends the global matchers to include toEqualValue. Allows you to expect deep value equality. It uses isEquals from lodash, but ignores function and prototype checking.
Setup (Typescript Example)
All you need to do is import jasmine-equal-value as a jasmine helper.
npm i jasmine-equal-value -D
// setup.ts
import 'jasmine-equal-value';
// jasmine.config.json
{
"helpers": [
"setup.ts",
],
}
describe('', () => {
it('', () => {
class Test { constructor(public test: string) { } }
expect(new Test('foo')).toEqualValue({ test: 'foo' }); // true
})
});