🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

goosemock

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goosemock

Package for mocking mongoose

1.5.1
latest
Source
npm
Version published
Weekly downloads
7
-46.15%
Maintainers
1
Weekly downloads
 
Created
Source

Goosemock

npm version npm

Goosemock is mongoose mocking framework. This package was created because we needed to write unit tests on a backend that used mongoose and we needed something to mock the behavior of mongoose but in a dynamic way. It is essentially an in memory database but without the need for a even a database server or any installations. All mongoose functions affect in-memory data data structures.

Installation

Install Goosemock with npm

npm install goosemock

Usage

Using goosemock is simple. Simply require and run it after mongoose like so:

const mongoose = require('mongoose')
const goosemock = require('goosemock')

goosemock()

Now all calls to mongoose functions will be executed in-memory. Note also that even mongoose.connect() will no longer be able to connect to the server as it is intercepted by goosemock.

Keywords

mongoose

FAQs

Package last updated on 26 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts