mockingoose
Advanced tools
Comparing version 2.15.0 to 2.15.1
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "mockingoose", | ||
"version": "2.15.0", | ||
"version": "2.15.1", | ||
"description": "A Jest package for mocking mongoose models", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
@@ -9,2 +9,3 @@ # Mockingoose [![CircleCI](https://circleci.com/gh/alonronin/mockingoose/tree/master.svg?style=svg)](https://circleci.com/gh/alonronin/mockingoose/tree/master) | ||
With NPM: | ||
```bash | ||
@@ -14,10 +15,12 @@ $ npm i mockingoose -D | ||
With Yarn: | ||
```bash | ||
$ yarn add mockingoose -D | ||
``` | ||
## Import the library | ||
```js | ||
// using commonJS | ||
const mockingoose = require('mockingoose').default; | ||
const mockingoose = require('mockingoose'); | ||
// using es201x | ||
import mockingoose from 'mockingoose'; | ||
``` | ||
@@ -29,3 +32,3 @@ | ||
// user.js | ||
import mongoose from 'mongoose'; | ||
const mongoose = require('mongoose'); | ||
const { Schema } = mongoose; | ||
@@ -39,3 +42,3 @@ | ||
export default mongoose.model('User', schema); | ||
module.exports = mongoose.model('User', schema); | ||
``` | ||
@@ -49,5 +52,5 @@ | ||
// __tests__/user.test.js | ||
import mockingoose from 'mockingoose'; | ||
const mockingoose = require('mockingoose'); | ||
import model from './user'; | ||
const model = require('./user'); | ||
@@ -98,4 +101,4 @@ describe('test mongoose User model', () => { | ||
// __tests__/user.test.js | ||
import mockingoose from 'mockingoose'; | ||
import model from './user'; | ||
const mockingoose = require('mockingoose'); | ||
const model = require('./user'); | ||
@@ -102,0 +105,0 @@ describe('test mongoose User model', () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42437
252