# to-have-property

> toHaveProperty matcher for Jasmine to check whether object has property or not.

Latest version **0.2.2** (published 2015-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-have-property
pnpm add to-have-property
yarn add to-have-property
bun add to-have-property
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2015-05-20 |
| First published | 2015-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Eugene Krevenets |
| Maintainers | hyzhak |
| Keywords | matcher, jasmine, unit tests |

## Links

- npm: https://www.npmjs.com/package/to-have-property
- Repository: https://github.com/hyzhak/to-have-property
- Issues: https://github.com/hyzhak/to-have-property/issues
- npm.io page: https://npm.io/package/to-have-property

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^3.9.1
- [jasmine](https://npm.io/package/jasmine.md) ^2.3.1

## Recent versions

- 0.2.2 (latest) — 2015-05-20
- 0.2.1 — 2015-05-20
- 0.2.0 — 2015-05-20
- 0.1.2 — 2015-05-13
- 0.1.0 — 2015-05-13

## README

# toHaveProperty [![npm](https://img.shields.io/npm/v/to-have-property.svg)](https://www.npmjs.com/package/to-have-property) [![Build Status](https://travis-ci.org/hyzhak/to-have-property.svg?branch=master)](https://travis-ci.org/hyzhak/to-have-property)

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

```javascript

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');
});


```

---
_Source: https://npm.io/package/to-have-property · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
