https://github.com/hexsprite/meteor-mock-id
This package patches Mongo.Collection on server side to generate consistent incremental IDs based on the name of the collection for testing purposes.
https://github.com/hexsprite/meteor-mock-id
meteor meteor-package testing
Last synced: 2 months ago
JSON representation
This package patches Mongo.Collection on server side to generate consistent incremental IDs based on the name of the collection for testing purposes.
- Host: GitHub
- URL: https://github.com/hexsprite/meteor-mock-id
- Owner: hexsprite
- Created: 2018-09-08T18:46:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-19T00:00:05.000Z (almost 2 years ago)
- Last Synced: 2025-01-29T10:18:04.165Z (4 months ago)
- Topics: meteor, meteor-package, testing
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This package patches Mongo.Collection on server side to generate consistent
incremental IDs based on the name of the collection.The intention is to use this in automated tests for snapshotting collections
of documents.As such this is a `testOnly` package.
They look like:
`actions2xxxxxxxxx`
and
`users2xxxxxxxxxxx`The results are padded to 17 characters and exclude 0 and 1 since they are not
considered "valid" Meteor mongo ID by SimpleSchema.The counters are reset after each test is run. Tested with `meteortesting:mocha`.
### INSTALLATION
Make sure that you put `hexsprite:mock-mongo-id` at the top of the
`.meteor/packages` file so that it can hook into things before any collections
are defined.