Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/saintedlama/drop-mongodb-collections

Drops all (non system) mongodb collections
https://github.com/saintedlama/drop-mongodb-collections

mongodb nodejs testing

Last synced: 3 months ago
JSON representation

Drops all (non system) mongodb collections

Awesome Lists containing this project

README

        

# drop-mongodb-collections

Drops all non system mongodb collections. To be used for tests.

[![Node.js CI](https://github.com/saintedlama/drop-mongodb-collections/actions/workflows/ci.yml/badge.svg)](https://github.com/saintedlama/drop-mongodb-collections/actions/workflows/ci.yml)

[![Coverage Status](https://coveralls.io/repos/github/saintedlama/drop-mongodb-collections/badge.svg)](https://coveralls.io/github/saintedlama/drop-mongodb-collections)

## Usage

```bash
> npm i drop-mongodb-collections --save-dev
```

```js
const dropMongoDbCollections = require('drop-mongodb-collections')('mongodb://localhost/tests');

// Mocha

describe('something', function() {
// Cleanup db before running tests
beforeEach(dropMongoDbCollections);

// Your tests go here
});
```