Use Prettier JS (#5017)

* Adds prettier

* Run lint before tests
This commit is contained in:
Florent Vilmart
2018-09-01 13:58:06 -04:00
committed by GitHub
parent 189cd259ee
commit d83a0b6808
240 changed files with 41098 additions and 29020 deletions

View File

@@ -1,14 +1,14 @@
const Config = require("../lib/Config");
const {PushQueue} = require("../lib/Push/PushQueue");
const Config = require('../lib/Config');
const { PushQueue } = require('../lib/Push/PushQueue');
describe('PushQueue', () => {
describe('With a defined channel', () => {
it('should be propagated to the PushWorker and PushQueue', (done) => {
it('should be propagated to the PushWorker and PushQueue', done => {
reconfigureServer({
push: {
queueOptions: {
disablePushWorker: false,
channel: 'my-specific-channel'
channel: 'my-specific-channel',
},
adapter: {
send() {
@@ -16,25 +16,31 @@ describe('PushQueue', () => {
},
getValidPushTypes() {
return [];
}
}
}
},
},
},
})
.then(() => {
const config = Config.get(Parse.applicationId);
expect(config.pushWorker.channel).toEqual('my-specific-channel', 'pushWorker.channel');
expect(config.pushControllerQueue.channel).toEqual('my-specific-channel', 'pushWorker.channel');
expect(config.pushWorker.channel).toEqual(
'my-specific-channel',
'pushWorker.channel'
);
expect(config.pushControllerQueue.channel).toEqual(
'my-specific-channel',
'pushWorker.channel'
);
})
.then(done, done.fail);
});
});
describe('Default channel', () => {
it('should be prefixed with the applicationId', (done) => {
it('should be prefixed with the applicationId', done => {
reconfigureServer({
push: {
queueOptions: {
disablePushWorker: false
disablePushWorker: false,
},
adapter: {
send() {
@@ -42,15 +48,19 @@ describe('PushQueue', () => {
},
getValidPushTypes() {
return [];
}
}
}
},
},
},
})
.then(() => {
const config = Config.get(Parse.applicationId);
expect(PushQueue.defaultPushChannel()).toEqual('test-parse-server-push');
expect(PushQueue.defaultPushChannel()).toEqual(
'test-parse-server-push'
);
expect(config.pushWorker.channel).toEqual('test-parse-server-push');
expect(config.pushControllerQueue.channel).toEqual('test-parse-server-push');
expect(config.pushControllerQueue.channel).toEqual(
'test-parse-server-push'
);
})
.then(done, done.fail);
});