Files
kami-parse-server/spec/PushQueue.spec.js
Diamond Lewis e6ac3b6932 fix(prettier): Properly handle lint-stage files (#6970)
Now handles top level files and recursive files in folders.

Set max line length to be 100
2020-10-25 15:06:58 -05:00

62 lines
1.8 KiB
JavaScript

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 => {
reconfigureServer({
push: {
queueOptions: {
disablePushWorker: false,
channel: 'my-specific-channel',
},
adapter: {
send() {
return Promise.resolve();
},
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'
);
})
.then(done, done.fail);
});
});
describe('Default channel', () => {
it('should be prefixed with the applicationId', done => {
reconfigureServer({
push: {
queueOptions: {
disablePushWorker: false,
},
adapter: {
send() {
return Promise.resolve();
},
getValidPushTypes() {
return [];
},
},
},
})
.then(() => {
const config = Config.get(Parse.applicationId);
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');
})
.then(done, done.fail);
});
});
});