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
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
const ParsePubSub = require('../lib/LiveQuery/ParsePubSub').ParsePubSub;
|
||||
|
||||
describe('ParsePubSub', function() {
|
||||
beforeEach(function(done) {
|
||||
describe('ParsePubSub', function () {
|
||||
beforeEach(function (done) {
|
||||
// Mock RedisPubSub
|
||||
const mockRedisPubSub = {
|
||||
createPublisher: jasmine.createSpy('createPublisherRedis'),
|
||||
createSubscriber: jasmine.createSpy('createSubscriberRedis'),
|
||||
};
|
||||
jasmine.mockLibrary(
|
||||
'../lib/Adapters/PubSub/RedisPubSub',
|
||||
'RedisPubSub',
|
||||
mockRedisPubSub
|
||||
);
|
||||
jasmine.mockLibrary('../lib/Adapters/PubSub/RedisPubSub', 'RedisPubSub', mockRedisPubSub);
|
||||
// Mock EventEmitterPubSub
|
||||
const mockEventEmitterPubSub = {
|
||||
createPublisher: jasmine.createSpy('createPublisherEventEmitter'),
|
||||
@@ -25,14 +21,13 @@ describe('ParsePubSub', function() {
|
||||
done();
|
||||
});
|
||||
|
||||
it('can create redis publisher', function() {
|
||||
it('can create redis publisher', function () {
|
||||
ParsePubSub.createPublisher({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createPublisher).toHaveBeenCalledWith({
|
||||
@@ -42,25 +37,23 @@ describe('ParsePubSub', function() {
|
||||
expect(EventEmitterPubSub.createPublisher).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('can create event emitter publisher', function() {
|
||||
it('can create event emitter publisher', function () {
|
||||
ParsePubSub.createPublisher({});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createPublisher).not.toHaveBeenCalled();
|
||||
expect(EventEmitterPubSub.createPublisher).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('can create redis subscriber', function() {
|
||||
it('can create redis subscriber', function () {
|
||||
ParsePubSub.createSubscriber({
|
||||
redisURL: 'redisURL',
|
||||
redisOptions: { socket_keepalive: true },
|
||||
});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createSubscriber).toHaveBeenCalledWith({
|
||||
@@ -70,18 +63,17 @@ describe('ParsePubSub', function() {
|
||||
expect(EventEmitterPubSub.createSubscriber).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('can create event emitter subscriber', function() {
|
||||
it('can create event emitter subscriber', function () {
|
||||
ParsePubSub.createSubscriber({});
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createSubscriber).not.toHaveBeenCalled();
|
||||
expect(EventEmitterPubSub.createSubscriber).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('can create publisher/sub with custom adapter', function() {
|
||||
it('can create publisher/sub with custom adapter', function () {
|
||||
const adapter = {
|
||||
createPublisher: jasmine.createSpy('createPublisher'),
|
||||
createSubscriber: jasmine.createSpy('createSubscriber'),
|
||||
@@ -96,8 +88,7 @@ describe('ParsePubSub', function() {
|
||||
});
|
||||
expect(adapter.createSubscriber).toHaveBeenCalled();
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createSubscriber).not.toHaveBeenCalled();
|
||||
@@ -106,27 +97,26 @@ describe('ParsePubSub', function() {
|
||||
expect(EventEmitterPubSub.createPublisher).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('can create publisher/sub with custom function adapter', function() {
|
||||
it('can create publisher/sub with custom function adapter', function () {
|
||||
const adapter = {
|
||||
createPublisher: jasmine.createSpy('createPublisher'),
|
||||
createSubscriber: jasmine.createSpy('createSubscriber'),
|
||||
};
|
||||
ParsePubSub.createPublisher({
|
||||
pubSubAdapter: function() {
|
||||
pubSubAdapter: function () {
|
||||
return adapter;
|
||||
},
|
||||
});
|
||||
expect(adapter.createPublisher).toHaveBeenCalled();
|
||||
|
||||
ParsePubSub.createSubscriber({
|
||||
pubSubAdapter: function() {
|
||||
pubSubAdapter: function () {
|
||||
return adapter;
|
||||
},
|
||||
});
|
||||
expect(adapter.createSubscriber).toHaveBeenCalled();
|
||||
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub')
|
||||
.RedisPubSub;
|
||||
const RedisPubSub = require('../lib/Adapters/PubSub/RedisPubSub').RedisPubSub;
|
||||
const EventEmitterPubSub = require('../lib/Adapters/PubSub/EventEmitterPubSub')
|
||||
.EventEmitterPubSub;
|
||||
expect(RedisPubSub.createSubscriber).not.toHaveBeenCalled();
|
||||
@@ -135,11 +125,8 @@ describe('ParsePubSub', function() {
|
||||
expect(EventEmitterPubSub.createPublisher).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
jasmine.restoreLibrary('../lib/Adapters/PubSub/RedisPubSub', 'RedisPubSub');
|
||||
jasmine.restoreLibrary(
|
||||
'../lib/Adapters/PubSub/EventEmitterPubSub',
|
||||
'EventEmitterPubSub'
|
||||
);
|
||||
jasmine.restoreLibrary('../lib/Adapters/PubSub/EventEmitterPubSub', 'EventEmitterPubSub');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user