From 5378de7398dbe85f97219085468b5149fddc7246 Mon Sep 17 00:00:00 2001 From: Drew Gross Date: Fri, 19 Feb 2016 19:00:43 -0800 Subject: [PATCH] Add server URL to tests --- spec/helper.js | 3 ++- spec/index.spec.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/helper.js b/spec/helper.js index 4a4d27c7..c89e2dbe 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -11,11 +11,13 @@ var DatabaseAdapter = require('../src/DatabaseAdapter'); var databaseURI = process.env.DATABASE_URI; var cloudMain = process.env.CLOUD_CODE_MAIN || './cloud/main.js'; +var port = 8378; // Default server configuration for tests. var defaultConfiguration = { databaseURI: databaseURI, cloud: cloudMain, + serverURL: 'http://localhost:' + port + '/1', appId: 'test', javascriptKey: 'test', dotNetKey: 'windows', @@ -36,7 +38,6 @@ var defaultConfiguration = { var api = new ParseServer(defaultConfiguration); var app = express(); app.use('/1', api); -var port = 8378; var server = app.listen(port); // Prevent reinitializing the server from clobbering Cloud Code diff --git a/spec/index.spec.js b/spec/index.spec.js index a92eab01..0e3eba5d 100644 --- a/spec/index.spec.js +++ b/spec/index.spec.js @@ -10,6 +10,7 @@ describe('server', () => { it('fails if database is unreachable', done => { setServerConfiguration({ databaseURI: 'mongodb://fake:fake@ds043605.mongolab.com:43605/drew3', + serverURL: 'http://localhost:8378/1', appId: 'test', javascriptKey: 'test', dotNetKey: 'windows',