@panda-clouds/parse-runner

0.49.0 • Public • Published

PCParseRunner

maintained by PandaClouds.com

PCParseRunner spins up dockerized "Parse Server" and "Mongo" instances for testing.

Installation

  1. If you want to use this library, you first need to install the Node.js.

  2. When you install node.js, will also be installed npm.

  3. Please run the following command.

npm install --save-dev @panda-clouds/parse-runner

Usage

Node.js

const PCParseRunner = require('@panda-clouds/parse-runner');
let Parse;

describe('a describe block', () => {

	const parseRunner = new PCParseRunner();

	parseRunner.parseVersion(version);

	// begin optional cloud code
	const cloud =
`
Parse.Cloud.define('myFunction', function(request, response) {
	return 'myResults';
});
`;
	parseRunner.cloud(cloud);
	// end optional cloud code

	beforeAll(async () => {
		Parse = await parseRunner.startParseServer();
	}, 1000 * 60 * 2);

	afterAll(async () => {
		await parseRunner.cleanUp();
	});

	it('should call a Parse function', async () => {
		const result = await Parse.Cloud.run('myFunction');

		expect(result).toBe('myResults');
		expect(result).not.toBe('superman');
	});
})

You can replace PCParseRunner with any variable.

Methods

Unit Tests are the best resource for learning functionality.

Contributions

Pull requests are welcome! here is a checklist to speed things up:

  • modify PCParseRunner.js
  • add unit tests in PCParseRunner.spec.js
  • run npm test
  • document method in README.md
  • add your name to 'Contributors' in README.md

Contributors

(Add your name)

Readme

Keywords

none

Package Sidebar

Install

npm i @panda-clouds/parse-runner

Weekly Downloads

1

Version

0.49.0

License

MIT

Unpacked Size

129 kB

Total Files

73

Last publish

Collaborators

  • mrmarcsmith