Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions spec/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
},
"rules": {
"no-console": [0],
"indent": ["error", 2]
"indent": ["error", 2],
"no-trailing-spaces": 2,
"eol-last": 2
}
}
}
4 changes: 2 additions & 2 deletions spec/AccountLockoutPolicy.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ describe("Account Lockout Policy: ", () => {
return isAccountLockoutError('username3', 'wrong password', 0.05, 1);
})
.then(() => {
// account should still be locked even after 2 seconds.
// account should still be locked even after 2 seconds.
return isAccountLockoutError('username3', 'wrong password', 0.05, 2000);
})
.then(() => {
Expand Down Expand Up @@ -297,7 +297,7 @@ describe("Account Lockout Policy: ", () => {
return loginWithWrongCredentialsShouldFail('username4', 'wrong password');
})
.then(() => {
// allow locked user to login after 3 seconds with a valid userid and password
// allow locked user to login after 3 seconds with a valid userid and password
return new Promise((resolve, reject) => {
setTimeout(() => {
Parse.User.logIn('username4', 'correct password')
Expand Down
10 changes: 5 additions & 5 deletions spec/Analytics.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const analyticsAdapter = {
appOpened: function() {},
appOpened: function() {},
trackEvent: function() {}
}

describe('AnalyticsController', () => {
it('should track a simple event', (done) => {

spyOn(analyticsAdapter, 'trackEvent').and.callThrough();
reconfigureServer({
analyticsAdapter
Expand All @@ -31,9 +31,9 @@ describe('AnalyticsController', () => {
done();
})
});

it('should track a app opened event', (done) => {

spyOn(analyticsAdapter, 'appOpened').and.callThrough();
reconfigureServer({
analyticsAdapter
Expand All @@ -58,4 +58,4 @@ describe('AnalyticsController', () => {
done();
})
})
})
})
6 changes: 3 additions & 3 deletions spec/ClientSDK.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ describe('ClientSDK', () => {
version: '1.9.0'
});
});

it('should properly sastisfy', () => {
expect(ClientSDK.compatible({
js: '>=1.9.0'
})("js1.9.0")).toBe(true);

expect(ClientSDK.compatible({
js: '>=1.9.0'
})("js2.0.0")).toBe(true);
Expand All @@ -38,4 +38,4 @@ describe('ClientSDK', () => {
js: '>=1.9.0'
})(undefined)).toBe(true);
})
})
})
2 changes: 1 addition & 1 deletion spec/HTTPRequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe("httpRequest", () => {
Parse._encode(httpResponse);
let serialized = JSON.stringify(httpResponse);
let result = JSON.parse(serialized);

expect(httpResponse.text).toEqual('{"foo":"bar"}');
expect(httpResponse.data).toEqual({foo: 'bar'});
expect(httpResponse.body).toEqual({foo: 'bar'});
Expand Down
2 changes: 1 addition & 1 deletion spec/Middlewares.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ describe('middlewares', () => {
});
});
});
});
});
4 changes: 2 additions & 2 deletions spec/MongoStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ describe_only_db('mongo')('MongoStorageAdapter', () => {

it("handles updating a single object with array, object date", (done) => {
let adapter = new MongoStorageAdapter({ uri: databaseURI });

let schema = { fields: {
array: { type: 'Array' },
object: { type: 'Object' },
date: { type: 'Date' },
} };


adapter.createObject('MyClass', schema, {})
.then(() => adapter._rawFind('MyClass', {}))
.then(results => {
Expand Down
4 changes: 2 additions & 2 deletions spec/MongoTransform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('parseObjectToMongoObjectForCreate', () => {
};
var output = transform.parseObjectToMongoObjectForCreate(null, input, {
fields: {
aRelation: { __type: 'Relation', className: 'Stuff' },
aRelation: { __type: 'Relation', className: 'Stuff' },
},
});
expect(output).toEqual({});
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('transformUpdate', () => {
};
var output = transform.transformUpdate(null, input, {
fields: {
aRelation: { __type: 'Relation', className: 'Stuff' },
aRelation: { __type: 'Relation', className: 'Stuff' },
},
});
expect(output).toEqual({});
Expand Down
6 changes: 3 additions & 3 deletions spec/ParseInstallation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ describe('Installations', () => {
expect(results.length).toEqual(1);
expect(results[0]['_id']).toEqual(secondObject._id);
done();
}).catch((error) => {
jfail(error);
done();
}).catch((error) => {
jfail(error);
done();
});
});

Expand Down
2 changes: 1 addition & 1 deletion spec/ParseLiveQueryServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ describe('ParseLiveQueryServer', function() {
}
}
});

parseLiveQueryServer._matchesACL(acl, client, requestId).then(function(isMatched) {
expect(isMatched).toBe(false);
done();
Expand Down
2 changes: 1 addition & 1 deletion spec/ParseServerRESTController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ describe('ParseServerRESTController', () => {
done();
});
});
});
});
6 changes: 3 additions & 3 deletions spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,7 @@ describe('Parse.User testing', () => {
req.object.set('foo', 'bar');
res.success();
});

let originalSessionToken;
let originalUserId;
// Simulate anonymous user save
Expand Down Expand Up @@ -2463,7 +2463,7 @@ describe('Parse.User testing', () => {
});

it('should send email when upgrading from anon', (done) => {

let emailCalled = false;
let emailOptions;
var emailAdapter = {
Expand Down Expand Up @@ -2768,7 +2768,7 @@ describe('Parse.User testing', () => {
});
});

it('should not fail querying non existing relations', done => {
it('should not fail querying non existing relations', done => {
let user = new Parse.User();
user.set({
username: 'hello',
Expand Down
2 changes: 1 addition & 1 deletion spec/RestQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('rest query', () => {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest'
};

let p0 = rp.get({
headers: headers,
url: 'http://localhost:8378/1/classes/TestParameterEncode?'
Expand Down
2 changes: 1 addition & 1 deletion spec/RevocableSessionsUpgrade.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ describe_only_db('mongo')('revocable sessions', () => {
done();
});
});
})
})
2 changes: 1 addition & 1 deletion spec/Schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ describe('SchemaController', () => {
}, () => {
expect(exist).toEqual(false);
});

})
.then(() => schema.deleteField('relationField', 'NewClass', config.database))
.then(() => schema.reloadData())
Expand Down
8 changes: 4 additions & 4 deletions spec/TwitterAuth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ describe('Twitter Auth', () => {
}, {
consumer_key: 'world'
}]).consumer_key).toEqual('hello')

// Multiple options, consumer_key not found
expect(function(){
expect(function(){
twitter.handleMultipleConfigurations({
consumer_key: 'some',
}, [{
Expand All @@ -23,7 +23,7 @@ describe('Twitter Auth', () => {
}).toThrow();

// Multiple options, consumer_key not found
expect(function(){
expect(function(){
twitter.handleMultipleConfigurations({
auth_token: 'token',
}, [{
Expand All @@ -47,4 +47,4 @@ describe('Twitter Auth', () => {
consumer_key: 'hello'
}).consumer_key).toEqual('hello');
});
});
});
2 changes: 1 addition & 1 deletion spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const SpecReporter = require('jasmine-spec-reporter');
jasmine.DEFAULT_TIMEOUT_INTERVAL = process.env.PARSE_SERVER_TEST_TIMEOUT || 5000;

jasmine.getEnv().clearReporters();
jasmine.getEnv().addReporter(new SpecReporter());
jasmine.getEnv().addReporter(new SpecReporter());

global.on_db = (db, callback, elseCallback) => {
if (process.env.PARSE_SERVER_TEST_DB == db) {
Expand Down
2 changes: 1 addition & 1 deletion spec/parsers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ describe('parsers', () => {
expect(parser(1)).toEqual(true);
expect(parser(2)).toEqual(false);
});
});
});
2 changes: 1 addition & 1 deletion spec/rest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var config = new Config('test');
let database = config.database;

describe('rest create', () => {

beforeEach(() => {
config = new Config('test');
});
Expand Down