Skip to content

This is an app project template about how to make automated tests for your Back4App Cloud Code.

Notifications You must be signed in to change notification settings

back4app/template-cloud-code-unit-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Back4App Cloud Code Testing Example

  • Clone this repo
git clone https://github.com/considine/b4a-cloud-code-test-example.git
cd b4a-cloud-code-test-example.git
  • Install the dependencies
npm install
  • Create a test Parse Server. You can set up your own local instance, or create an app on Back4App (call it test-app or something to differentiate between production applications)

    • This will be used to run tests without corrupting live production data
  • Grab your keys from the Parse Dashboard

  1. Go to your Parse Dashboard
  2. Select the test application
  3. Click 'App Settings' on the left hand side, and then select 'Security and Keys'
  • Open up the file spec/constants.js, and paste in your master key and application id FROM YOUR TEST SERVER!

  • Run the tests:

./node_modules/jasmine/bin/jasmine.js spec/signup-user.spec.js

You can also install Jasmine globally if you prefer the command be prettier:

npm install -g jasmine
jasmine spec/signup-user.spec.js

OR you can use the npm command

npm run test

About

This is an app project template about how to make automated tests for your Back4App Cloud Code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published