Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zation/chai-like-mongoose

The mongoose plugin for chai-like
https://github.com/zation/chai-like-mongoose

Last synced: about 7 hours ago
JSON representation

The mongoose plugin for chai-like

Awesome Lists containing this project

README

        

# chai-like-mongo
The mongoose plugin for chai-like used to compare object id.

## Install

Install with [npm](https://www.npmjs.com/package/chai-like-mongoose)

```bash
npm install --save-dev chai-like-mongoose
```

## Usage

```js
var chai = require('chai');
var like = require('chai-like');

like.extend(require('chai-like-mongoose'));
chai.use(like);
```

## Assertions

Compare two object id.

```js
var mongoose = require('mongoose');
var objectId = mongoose.Types.ObjectId('123456789012345678901234');

objectId.should.like('123456789012345678901234');
objectId.should.not.like('123456789012345678901235');
```