Skip to content

Gives you methods to clear your Mongo database and collections for testing purposes

License

Notifications You must be signed in to change notification settings

fractal-code/cleaner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xolv.io Cleaner

This package clears your entire database for testing purposes.

Get the Book

To learn more about testing with Meteor, consider purchasing our book The Meteor Testing Manual.

Your support helps us continue our work on Velocity and related frameworks.

Installation

meteor add xolvio:cleaner

Usage

resetDatabase only resets your database when it is executed inside a debugOnly environment.

You can clear your database with:

var cleaner = Package['xolvio:cleaner'];

// delete all collections
cleaner.resetDatabase();

You can do this inside a Meteor method and call it from your client tests.

Don't reset certain collection

var cleaner = Package['xolvio:cleaner'];

// delete all collections except myCollection
cleaner.resetDatabase({excludedCollections: ['myCollection']);

About

Gives you methods to clear your Mongo database and collections for testing purposes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%