Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guywaldman/db_systems_hw4_tests
Tests for 236363 HW4 wet
https://github.com/guywaldman/db_systems_hw4_tests
Last synced: about 1 month ago
JSON representation
Tests for 236363 HW4 wet
- Host: GitHub
- URL: https://github.com/guywaldman/db_systems_hw4_tests
- Owner: guywaldman
- License: mit
- Created: 2018-01-15T23:03:27.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T22:09:36.000Z (almost 7 years ago)
- Last Synced: 2023-11-29T23:37:29.304Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.15 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HW4 Wet Tests 🚀
## Caveat
These tests might not be 100% accurate, may contain mistakes and may contain false positives/negatives.
Please use them at your discretion## Requirements
* MongoDB shell version: `>=3.4.6`
* MongoDB server version: `>=3.4.6`## Usage
### With Node.js
> Make sure that you've moved `script.js` to the root directory, the NPM scripts rely on this.
```bash
$ npm run test
```### Without Node.js
> Assuming your MongoDB server is running on localhost:27017.
> Otherwise, run instead of the first command, for example:
> ```bash
> # replace as needed
> $ mongo test/lib/populate.js
> ``````bash
# populate the DB
$ mongo test/lib/populate.js
# run your script
$ mongo script.js
# run the test
$ mongo test/script.test.js
# drop the collections
$ mongo test/lib/destroy.js
```### If the above doesn't work
Try running from the mongo shell:
```javascript
#!/usr/local/bin/mongo// populate the DB
load('test/lib/populate.js');
// run your script
load('script.js');
// run the test
load('test/script.test.js');
// drop the collections
load('test/lib/destroy.js');
```In either case, you can always just run the `populate.js` script which (surprise, surprise) populates the DB, running your script and then comparing the `results1, results2, results3` collections to the expected one (see the [diffing](https://github.com/guywald1/db_systems_hw4_tests#diffing) part).
## Output
If you passed, there should be no special output.
Something like this:If you failed, there should be indication as to which test you've failed (and sometimes a suggestion as to why you probably failed).
## Diffing
To see expected output, run:
```bash
$ mongo test/lib/showExpected.js
```