chore(package): update jasmine to version 3.0.0 (#4553)

* chore(package): update jasmine to version 3.0.0

Closes #4547

* Fixes failing tests for jasmine 3.0

Starting 3.0, done(something) will fail

* Update tests so they dont leverage var, but let and const

With jasmine 3.0, the randomization engine was making the test fails because of the scope of `var`

* Remove randomizer

* Use same adapter for PG tests, drop table to ensure the tests dont side effect
This commit is contained in:
Florent Vilmart
2018-02-17 09:55:30 -05:00
committed by GitHub
parent 8ec7785d53
commit b754d51e8e
81 changed files with 2698 additions and 2704 deletions

View File

@@ -1,10 +1,10 @@
"use strict"
var request = require('request');
var parseServerPackage = require('../package.json');
var MockEmailAdapterWithOptions = require('./MockEmailAdapterWithOptions');
var ParseServer = require("../src/index");
var Config = require('../src/Config');
var express = require('express');
const request = require('request');
const parseServerPackage = require('../package.json');
const MockEmailAdapterWithOptions = require('./MockEmailAdapterWithOptions');
const ParseServer = require("../src/index");
const Config = require('../src/Config');
const express = require('express');
import MongoStorageAdapter from '../src/Adapters/Storage/Mongo/MongoStorageAdapter';
@@ -270,7 +270,7 @@ describe('server', () => {
});
it('can create a parse-server v1', done => {
var parseServer = new ParseServer.default(Object.assign({},
const parseServer = new ParseServer.default(Object.assign({},
defaultConfiguration, {
appId: "aTestApp",
masterKey: "aTestMasterKey",
@@ -279,15 +279,15 @@ describe('server', () => {
promise
.then(() => {
expect(Parse.applicationId).toEqual("aTestApp");
var app = express();
const app = express();
app.use('/parse', parseServer.app);
var server = app.listen(12666);
var obj = new Parse.Object("AnObject");
var objId;
const server = app.listen(12666);
const obj = new Parse.Object("AnObject");
let objId;
obj.save().then((obj) => {
objId = obj.id;
var q = new Parse.Query("AnObject");
const q = new Parse.Query("AnObject");
return q.first();
}).then((obj) => {
expect(obj.id).toEqual(objId);
@@ -360,7 +360,7 @@ describe('server', () => {
it('properly gives publicServerURL when set', done => {
reconfigureServer({ publicServerURL: 'https://myserver.com/1' })
.then(() => {
var config = Config.get('test', 'http://localhost:8378/1');
const config = Config.get('test', 'http://localhost:8378/1');
expect(config.mount).toEqual('https://myserver.com/1');
done();
});
@@ -369,7 +369,7 @@ describe('server', () => {
it('properly removes trailing slash in mount', done => {
reconfigureServer({})
.then(() => {
var config = Config.get('test', 'http://localhost:8378/1/');
const config = Config.get('test', 'http://localhost:8378/1/');
expect(config.mount).toEqual('http://localhost:8378/1');
done();
});