0.2.2 • Published 9 years ago

to-have-property v0.2.2

Weekly downloads
13
License
MIT
Repository
github
Last release
9 years ago

toHaveProperty npm Build Status

toHaveProperty matcher for Jasmine (http://jasmine.github.io/) to check whether object has property or not.

Installation

npm install to-have-property --save-dev

How to use

require('to-have-property');

it('should find property in object', function() {
    expect({ x: 10 }).toHaveProperty('x');
});

it('should find property in object and check is it equal to certain value', function() {
    expect({ y: 123}).toHaveProperty('y', 123);
});

it('should find properties in object and check are they equal to values', function() {
	expect({ x: 1, y: 2, z: 3}).toHaveProperties({'x': 1, 'y': 2});
});

it('should find all properties in object', function() {
    expect({ x: 1, y: 2, z: 3 }).toHaveProperties('x', 'y');
});
0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.0

9 years ago