Skip to content

Commit 32f118c

Browse files
committed
ensure reconfigureServer when changed
1 parent d31f08c commit 32f118c

21 files changed

+817
-496
lines changed

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"form-data": "3.0.0",
8989
"husky": "4.2.5",
9090
"jasmine": "3.5.0",
91+
"jasmine-spec-reporter": "6.0.0",
9192
"jsdoc": "3.6.3",
9293
"jsdoc-babel": "0.5.0",
9394
"lint-staged": "10.2.3",

spec/AccountLockoutPolicy.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ const isAccountLockoutError = function (username, password, duration, waitTime)
4040
};
4141

4242
describe('Account Lockout Policy: ', () => {
43-
afterAll(async () => {
44-
await reconfigureServer();
45-
});
4643
it('account should not be locked even after failed login attempts if account lockout policy is not set', done => {
4744
reconfigureServer({
4845
appName: 'unlimited',

spec/AdapterLoader.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,11 @@ describe('AdapterLoader', () => {
132132
expect(() => {
133133
reconfigureServer({
134134
push: pushAdapterOptions,
135-
}).then(async () => {
135+
}).then(() => {
136136
const config = Config.get(Parse.applicationId);
137137
const pushAdapter = config.pushWorker.adapter;
138138
expect(pushAdapter.getValidPushTypes()).toEqual(['ios']);
139139
expect(pushAdapter.options).toEqual(pushAdapterOptions);
140-
await reconfigureServer();
141140
done();
142141
});
143142
}).not.toThrow();

spec/AudienceRouter.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ describe('AudiencesRouter', () => {
416416
} catch (e) {
417417
expect(e.data.code).toBe(107);
418418
expect(e.data.error).toBe('Could not add field lorem');
419-
await reconfigureServer();
420419
}
421420
});
422421
});

spec/CloudCode.spec.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,17 @@ describe('Cloud Code', () => {
2323
reconfigureServer({
2424
cloud: __dirname + '/cloud/cloudCodeRelativeFile.js',
2525
}).then(() => {
26-
Parse.Cloud.run('cloudCodeInFile', {}).then(async result => {
26+
Parse.Cloud.run('cloudCodeInFile', {}).then(result => {
2727
expect(result).toEqual('It is possible to define cloud code in a file.');
28-
await reconfigureServer();
2928
done();
3029
});
3130
});
3231
});
3332

3433
it('can load relative cloud code file', done => {
3534
reconfigureServer({ cloud: './spec/cloud/cloudCodeAbsoluteFile.js' }).then(() => {
36-
Parse.Cloud.run('cloudCodeInFile', {}).then(async result => {
35+
Parse.Cloud.run('cloudCodeInFile', {}).then(result => {
3736
expect(result).toEqual('It is possible to define cloud code in a file.');
38-
await reconfigureServer();
3937
done();
4038
});
4139
});
@@ -1264,9 +1262,8 @@ describe('Cloud Code', () => {
12641262
},
12651263
})
12661264
)
1267-
.then(async response => {
1265+
.then(response => {
12681266
expect(response.data.result).toEqual('second data');
1269-
await reconfigureServer();
12701267
done();
12711268
})
12721269
.catch(done.fail);
@@ -1821,7 +1818,6 @@ describe('beforeSave hooks', () => {
18211818
const res = await query.find();
18221819
expect(res.length).toEqual(1);
18231820
expect(res[0].get('foo')).toEqual('bar');
1824-
await reconfigureServer();
18251821
});
18261822
});
18271823

@@ -2931,10 +2927,6 @@ describe('afterLogin hook', () => {
29312927
});
29322928

29332929
describe('saveFile hooks', () => {
2934-
afterAll(async () => {
2935-
await reconfigureServer();
2936-
});
2937-
29382930
it('beforeSaveFile should return file that is already saved and not save anything to files adapter', async () => {
29392931
await reconfigureServer({ filesAdapter: mockAdapter });
29402932
const createFileSpy = spyOn(mockAdapter, 'createFile').and.callThrough();

spec/EnableSingleSchemaCache.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ describe('Enable single schema cache', () => {
1212
});
1313
});
1414

15-
afterAll(async () => {
16-
await reconfigureServer();
17-
});
1815
it('can perform multiple create and query operations', done => {
1916
let config = fakeRequestForConfig();
2017
let nobody = auth.nobody(config);

spec/FilesController.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('FilesController', () => {
5555
)
5656
.then(() => new Promise(resolve => setTimeout(resolve, 200)))
5757
.then(() => logController.getLogs({ from: Date.now() - 1000, size: 1000 }))
58-
.then(async logs => {
58+
.then(logs => {
5959
// we get two logs here: 1. the source of the failure to save the file
6060
// and 2 the message that will be sent back to the client.
6161

@@ -66,7 +66,6 @@ describe('FilesController', () => {
6666
expect(log2.level).toBe('error');
6767
expect(log2.code).toBe(130);
6868

69-
await reconfigureServer();
7069
done();
7170
});
7271
});

spec/GridFSBucketStorageAdapter.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ describe_only_db('mongo')('GridFSBucket and GridStore interop', () => {
392392
});
393393
fileData = response.data;
394394
expect(fileData.metadata).toEqual(metadata);
395-
await reconfigureServer();
396395
});
397396

398397
it('should handle getMetadata error', async () => {

spec/Idempotency.spec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ describe_only_db('mongo')('Idempotency', () => {
4141
ttl: 30,
4242
});
4343
});
44-
45-
afterAll(async () => {
46-
await reconfigureServer();
47-
});
4844
// Tests
4945
it('should enforce idempotency for cloud code function', async () => {
5046
let counter = 0;

spec/LdapAuth.spec.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const port = 12345;
55
const sslport = 12346;
66

77
describe('Ldap Auth', () => {
8-
afterAll(async () => {
9-
await reconfigureServer();
10-
});
11-
128
it('Should fail with missing options', done => {
139
ldap
1410
.validateAuthData({ id: 'testuser', password: 'testpw' })

0 commit comments

Comments
 (0)