Skip to content

Commit 1405e2c

Browse files
committed
Run tools:lintfix
1 parent 1b03c75 commit 1405e2c

18 files changed

+142
-148
lines changed

packages/meteor-collection-hooks/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import './wrappers.js'
66

77
CollectionHooks.getUserId = function getUserId () {
88
let userId
9-
9+
1010
Tracker.nonreactive(() => {
1111
userId = Meteor.userId && Meteor.userId()
1212
})

packages/meteor-collection-hooks/collection-hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function setupHookRegistrationMethods (collection) {
131131
hook,
132132
options: CollectionHooks.initOptions(options, timing, method)
133133
}
134-
134+
135135
const hooksArray = collection[HOOKS_PROPERTY][method][timing]
136136
hooksArray.push(target)
137137

packages/meteor-collection-hooks/find.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ CollectionHooks.defineWrapper('find', function (userId, originalMethod, instance
4747
})
4848

4949
return cursor
50-
})
50+
})

tests-app/direct.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ describe('direct - hooks should not be fired when using .direct', function () {
7979

8080
// STEP 1: Record how many hooks fire with normal operations
8181
const initialHookCount = hookCount
82-
82+
8383
collection.insert({ _id: 'test', test: 1 })
8484
collection.update({ _id: 'test' }, { $set: { test: 1 } }, { test: 1 })
8585
collection.find({}, { test: 1 })
8686
collection.findOne({}, { test: 1 })
8787
collection.remove({ _id: 'test' })
8888

8989
const normalOperationsHookCount = hookCount
90-
90+
9191
// STEP 2: Verify hooks were called for normal operations
9292
expect(normalOperationsHookCount).toBeGreaterThan(initialHookCount)
9393

tests-app/find_userid.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ if (Meteor.isClient) {
6363
Meteor.user = originalUser
6464
})
6565
})
66-
}
66+
}

tests-app/find_users.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import expect from 'expect'
66
// When running in isolation, both tests pass
77
// When running only one, both work, too
88
describe('users - find hooks', function () {
9-
// it('should be capable of being used on special Meteor.users collection', async function () {
9+
// it('should be capable of being used on special Meteor.users collection', async function () {
1010

1111
// const aspect1 = Meteor.users.before.find(function (userId, selector, options) {
1212
// if (selector && selector.test) {
@@ -21,9 +21,9 @@ describe('users - find hooks', function () {
2121
// })
2222

2323
// const selector = { test: 1 }
24-
24+
2525
// const cursor = Meteor.users.find(selector)
26-
26+
2727
// expect(Object.prototype.hasOwnProperty.call(selector, 'a')).toBe(true)
2828
// expect(Object.prototype.hasOwnProperty.call(selector, 'b')).toBe(true)
2929
// aspect1.remove()

tests-app/findone_userid.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import expect from 'expect'
44

55
if (Meteor.isClient) {
66
describe('findone - client side', function () {
7-
const originalMeteorUserId = Meteor.userId;
8-
7+
const originalMeteorUserId = Meteor.userId
8+
99
before(function () {
10-
Meteor.userId = () => 'findone-client-side-user-id';
10+
Meteor.userId = () => 'findone-client-side-user-id'
1111
})
12-
12+
1313
after(function () {
1414
Meteor.userId = originalMeteorUserId
1515
})
@@ -24,7 +24,7 @@ if (Meteor.isClient) {
2424
}
2525
})
2626

27-
await collection.findOneAsync({}, { test: 1 })
27+
await collection.findOneAsync({}, { test: 1 })
2828
expect(beforeFindOneUserId).toBe('findone-client-side-user-id')
2929
})
3030

@@ -38,8 +38,8 @@ if (Meteor.isClient) {
3838
}
3939
})
4040

41-
await collection.findOneAsync({}, { test: 1 })
42-
expect(afterFindOneUserId).toBe('findone-client-side-user-id')
43-
})
41+
await collection.findOneAsync({}, { test: 1 })
42+
expect(afterFindOneUserId).toBe('findone-client-side-user-id')
43+
})
4444
})
45-
}
45+
}

tests-app/insert_both.test.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ if (Meteor.isServer) {
6666
}
6767

6868
if (Meteor.isClient) {
69-
7069
Meteor.subscribe('test_insert_publish_collection2')
7170

7271
describe('insert - client side', function () {
73-
7472
let originalUserId
7573
let originalUser
76-
74+
7775
before(() => {
78-
7976
originalUserId = Meteor.userId
8077
originalUser = Meteor.user
8178

@@ -111,16 +108,16 @@ if (Meteor.isClient) {
111108
.count()
112109
).toBe(1)
113110
})
114-
111+
115112
it('hooks are not called for sync methods', function () {
116113
const collectionForSync = new Mongo.Collection(null)
117114
let beforeCalled = false
118115
let afterCalled = false
119-
116+
120117
collectionForSync.before.insert(function (userId, selector, options) {
121118
beforeCalled = true
122119
})
123-
120+
124121
collectionForSync.after.insert(function (userId, selector, options) {
125122
afterCalled = true
126123
})
@@ -130,10 +127,10 @@ if (Meteor.isClient) {
130127
expect(beforeCalled).toBe(false)
131128
expect(afterCalled).toBe(false)
132129
})
133-
130+
134131
after(() => {
135132
Meteor.userId = originalUserId
136133
Meteor.user = originalUser
137134
})
138135
})
139-
}
136+
}

tests-app/insert_local.test.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ describe('Insert Local Collection Tests', function () {
1717
}
1818
})
1919

20-
2120
it('should fire before and after hooks with correct userId for normal collection in local-only contexts', async function () {
2221
const collection = new Mongo.Collection(null)
2322
let beforeUserId = 'not set'
@@ -69,14 +68,14 @@ describe('Insert Local Collection Tests', function () {
6968
it('local collection document should have extra property added before being inserted', async function () {
7069
const collection = new Mongo.Collection(null)
7170
const tmp = {}
72-
71+
7372
collection.before.insert(function (userId, doc) {
7473
tmp.typeof_userId = typeof userId
7574
doc.before_insert_value = true
7675
})
77-
76+
7877
await collection.insertAsync({ start_value: true })
79-
78+
8079
if (Meteor.isServer) {
8180
expect(tmp.typeof_userId).toBe('undefined', 'Local collection on server should NOT know about a userId')
8281
} else {
@@ -87,18 +86,18 @@ describe('Insert Local Collection Tests', function () {
8786

8887
it('local collection should fire after-insert hook', async function () {
8988
const collection = new Mongo.Collection(null)
90-
89+
9190
collection.after.insert(function (userId, doc) {
9291
if (Meteor.isServer) {
9392
expect(typeof userId).toBe('undefined', 'Local collection on server should NOT know about a userId')
9493
} else {
9594
expect(typeof userId).toBe('string', 'There should be a userId on the client')
9695
}
97-
96+
9897
expect(doc.start_value).not.toBe(undefined, 'doc should have start_value')
9998
expect(this._id).not.toBe(undefined, 'should provide inserted _id on this')
10099
})
101-
100+
102101
await collection.insertAsync({ start_value: true })
103102
})
104-
})
103+
})

tests-app/remove_both.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if (Meteor.isClient) {
9898
++c
9999
}
100100
const originalUserId = Meteor.userId
101-
const originalUser = Meteor.user
101+
const originalUser = Meteor.user
102102

103103
// Mock a test user
104104
Meteor.userId = () => 'remove-both-user-id'

0 commit comments

Comments
 (0)