---
title: Local development and testing
nav: Local development
group: Build your app
updated: 2026-11-13
description: Run your SashiDo app's cloud code on your machine with a local Parse Server, and test functions and triggers automatically before you deploy.
keywords: parse server local development, test parse cloud code, parse server jest, mongodb memory server parse, parse cloud code unit tests
---

Your cloud code is plain Node.js on Parse Server, so it runs on your machine the same way. Develop and test locally, then push to deploy.

## Run a local server

You need Node.js and MongoDB (e.g. `docker run -d -p 27017:27017 mongo:6`). In your app's repository, install the Parse Server version your app runs (**Runtime › Parse Server Version**):

```bash
npm install express parse-server@6.5.11
```

Then a `local.js` next to `cloud/`:

```javascript
// local.js: a local Parse Server with this repository's cloud code
const express = require('express');
const { ParseServer } = require('parse-server');

const port = 1337;

async function main() {
  const server = new ParseServer({
    databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev',
    appId: 'local',
    masterKey: 'local-master-key',
    serverURL: `http://localhost:${port}/1`,
    cloud: './cloud/main.js',
  });
  await server.start();

  const app = express();
  app.use(express.static('public'));
  app.use('/1', server.app);
  app.use('/', require('./cloud/main.js').app || ((req, res, next) => next()));
  app.listen(port, () => console.log(`Parse Server on http://localhost:${port}/1`));
}

main();
```

```bash
node local.js
```

Point your client at `http://localhost:1337/1` with the app ID `local`. On Parse Server 3.x and 4.x there is no `start()`: mount the server itself, `app.use('/1', server)`; the repository's own `index.js` is written that way.

Don't put your production keys or the production Database URL in local code: develop against a local database, or a copy.

## Test automatically

With Jest and an in-memory MongoDB, each test run gets a fresh database:

```bash
npm install --save-dev jest mongodb-memory-server parse
```

```javascript
// test/cloud.test.js
const express = require('express');
const { MongoMemoryServer } = require('mongodb-memory-server');
const { ParseServer } = require('parse-server');
const Parse = require('parse/node');

let mongo, http;

beforeAll(async () => {
  mongo = await MongoMemoryServer.create();
  const server = new ParseServer({
    databaseURI: mongo.getUri(),
    appId: 'test',
    masterKey: 'test-master-key',
    serverURL: 'http://localhost:1338/1',
    cloud: './cloud/main.js',
  });
  await server.start();
  http = express().use('/1', server.app).listen(1338);

  Parse.initialize('test', undefined, 'test-master-key');
  Parse.serverURL = 'http://localhost:1338/1';
});

afterAll(async () => {
  http.close();
  await mongo.stop();
});

test('a review needs 1 to 5 stars', async () => {
  const review = new Parse.Object('Review', { stars: 9 });
  await expect(review.save()).rejects.toThrow('stars must be 1 to 5');
});

test('averageRating averages the stars', async () => {
  await Parse.Object.saveAll([
    new Parse.Object('Review', { movie: 'Arrival', stars: 4 }),
    new Parse.Object('Review', { movie: 'Arrival', stars: 5 }),
  ]);
  expect(await Parse.Cloud.run('averageRating', { movie: 'Arrival' })).toBe(4.5);
});
```

Run them in CI before every push: see [CI/CD](/en/docs/developers/ci-cd).

## Debug

- `console.log` locally prints to your terminal; on SashiDo it goes to **Core › Logs**.
- `node --inspect local.js` lets you set breakpoints in your editor or Chrome's DevTools.
- Errors that happen only on SashiDo: compare the Parse Server version and the [environment variables](/en/docs/developers/api#environment-variables), then read the logs, or ask your assistant through [MCP](/en/docs/developers/mcp) to find the failing code.
