Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ampme/parse-server-test-runner
A tool for programmatically starting Parse Server
https://github.com/ampme/parse-server-test-runner
jasmine mocha parse parse-server
Last synced: 3 months ago
JSON representation
A tool for programmatically starting Parse Server
- Host: GitHub
- URL: https://github.com/ampme/parse-server-test-runner
- Owner: AmpMe
- License: apache-2.0
- Created: 2017-08-21T19:03:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T18:39:24.000Z (about 6 years ago)
- Last Synced: 2024-10-14T07:42:40.450Z (3 months ago)
- Topics: jasmine, mocha, parse, parse-server
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 19
- Watchers: 3
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Parse Server Test Runner
[![npm version](https://img.shields.io/npm/v/parse-server-test-runner.svg?style=flat)](https://www.npmjs.com/package/parse-server-test-runner)
This library allows [Parse Server](https://github.com/parse-community/parse-server) to be set up programmatically for testing purposes.
## Example
This is an example of a Jasmine spec using `parse-server-test-runner`.
The timeout is set to 2 minutes because downloading MongoDB might take a few minutes.```javascript
const { startParseServer, stopParseServer, dropDB } = require('parse-server-test-runner');// ...
describe('my spec', () => {
beforeAll((done) => {
const appId = 'test';
const masterKey = 'test';
const javascriptKey = 'test';startParseServer({ appId, masterKey, javascriptKey })
.then(() => {
Parse.initialize(appId, masterKey, javascriptKey);
Parse.serverURL = 'http://localhost:30001/1';
})
.then(done).catch(done.fail);
}, 100 * 60 * 2);afterAll((done) => {
stopParseServer()
.then(done).catch(done.fail);
});beforeEach((done) => {
dropDB()
.then(done).catch(done.fail);
});it('should work', (done) => {
const q = new Parse.Query('_Installation')
q.limit(5)
.find({ useMasterKey: true })
.then(console.log)
.then(done).catch(done.fail);
});
});
```