Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/saintedlama/drop-mongodb-collections
- Owner: saintedlama
- Created: 2016-06-13T08:30:44.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T18:00:22.000Z (about 2 years ago)
- Last Synced: 2024-10-12T12:25:40.801Z (3 months ago)
- Topics: mongodb, nodejs, testing
- Language: JavaScript
- Size: 687 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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
});
```