|
3 | 3 | // When running in isolation, both tests pass |
4 | 4 | // When running only one, both work, too |
5 | 5 | // describe('users - find hooks', function () { |
6 | | - // it('should be capable of being used on special Meteor.users collection', async function () { |
| 6 | +// it('should be capable of being used on special Meteor.users collection', async function () { |
7 | 7 |
|
8 | | - // const aspect1 = Meteor.users.before.find(function (userId, selector, options) { |
9 | | - // if (selector && selector.test) { |
10 | | - // selector.a = 1 |
11 | | - // } |
12 | | - // }) |
| 8 | +// const aspect1 = Meteor.users.before.find(function (userId, selector, options) { |
| 9 | +// if (selector && selector.test) { |
| 10 | +// selector.a = 1 |
| 11 | +// } |
| 12 | +// }) |
13 | 13 |
|
14 | | - // const aspect2 = Meteor.users.after.find(function (userId, selector, options) { |
15 | | - // if (selector && selector.test) { |
16 | | - // selector.b = 1 |
17 | | - // } |
18 | | - // }) |
| 14 | +// const aspect2 = Meteor.users.after.find(function (userId, selector, options) { |
| 15 | +// if (selector && selector.test) { |
| 16 | +// selector.b = 1 |
| 17 | +// } |
| 18 | +// }) |
19 | 19 |
|
20 | | - // const selector = { test: 1 } |
| 20 | +// const selector = { test: 1 } |
21 | 21 |
|
22 | | - // const cursor = Meteor.users.find(selector) |
| 22 | +// const cursor = Meteor.users.find(selector) |
23 | 23 |
|
24 | | - // expect(Object.prototype.hasOwnProperty.call(selector, 'a')).toBe(true) |
25 | | - // expect(Object.prototype.hasOwnProperty.call(selector, 'b')).toBe(true) |
26 | | - // aspect1.remove() |
27 | | - // aspect2.remove() |
| 24 | +// expect(Object.prototype.hasOwnProperty.call(selector, 'a')).toBe(true) |
| 25 | +// expect(Object.prototype.hasOwnProperty.call(selector, 'b')).toBe(true) |
| 26 | +// aspect1.remove() |
| 27 | +// aspect2.remove() |
28 | 28 |
|
29 | | - // }) |
| 29 | +// }) |
30 | 30 |
|
31 | | - // it('should be capable of being used on wrapped Meteor.users collection', async function () { |
32 | | - // function TestUser (doc) { |
33 | | - // return Object.assign(this, doc) |
34 | | - // } |
| 31 | +// it('should be capable of being used on wrapped Meteor.users collection', async function () { |
| 32 | +// function TestUser (doc) { |
| 33 | +// return Object.assign(this, doc) |
| 34 | +// } |
35 | 35 |
|
36 | | - // Meteor.users.__transform = doc => new TestUser(doc) |
| 36 | +// Meteor.users.__transform = doc => new TestUser(doc) |
37 | 37 |
|
38 | | - // const MeteorUsersFind = Meteor.users.find |
| 38 | +// const MeteorUsersFind = Meteor.users.find |
39 | 39 |
|
40 | | - // Meteor.users.find = function (selector = {}, options = {}) { |
41 | | - // return MeteorUsersFind.call(this, selector, { transform: Meteor.users.__transform, ...options }) |
42 | | - // } |
| 40 | +// Meteor.users.find = function (selector = {}, options = {}) { |
| 41 | +// return MeteorUsersFind.call(this, selector, { transform: Meteor.users.__transform, ...options }) |
| 42 | +// } |
43 | 43 |
|
44 | | - // // eslint-disable-next-line array-callback-return |
45 | | - // const aspect1 = Meteor.users.before.find(function (userId, selector, options) { |
46 | | - // if (selector && selector.test) { |
47 | | - // selector.a = 1 |
48 | | - // } |
49 | | - // }) |
| 44 | +// // eslint-disable-next-line array-callback-return |
| 45 | +// const aspect1 = Meteor.users.before.find(function (userId, selector, options) { |
| 46 | +// if (selector && selector.test) { |
| 47 | +// selector.a = 1 |
| 48 | +// } |
| 49 | +// }) |
50 | 50 |
|
51 | | - // // eslint-disable-next-line array-callback-return |
52 | | - // const aspect2 = Meteor.users.after.find(function (userId, selector, options) { |
53 | | - // if (selector && selector.test) { |
54 | | - // selector.b = 1 |
55 | | - // } |
56 | | - // }) |
| 51 | +// // eslint-disable-next-line array-callback-return |
| 52 | +// const aspect2 = Meteor.users.after.find(function (userId, selector, options) { |
| 53 | +// if (selector && selector.test) { |
| 54 | +// selector.b = 1 |
| 55 | +// } |
| 56 | +// }) |
57 | 57 |
|
58 | | - // const selector = { test: 1 } |
59 | | - // Meteor.users.find(selector) |
60 | | - // expect(Object.prototype.hasOwnProperty.call(selector, 'a')).toBe(true) |
61 | | - // expect(Object.prototype.hasOwnProperty.call(selector, 'b')).toBe(true) |
62 | | - // aspect1.remove() |
63 | | - // aspect2.remove() |
| 58 | +// const selector = { test: 1 } |
| 59 | +// Meteor.users.find(selector) |
| 60 | +// expect(Object.prototype.hasOwnProperty.call(selector, 'a')).toBe(true) |
| 61 | +// expect(Object.prototype.hasOwnProperty.call(selector, 'b')).toBe(true) |
| 62 | +// aspect1.remove() |
| 63 | +// aspect2.remove() |
64 | 64 |
|
65 | | - // // Remove this line - it's not testing hook functionality |
66 | | - // // expect(await Meteor.users.find().countAsync()).not.toBe(0) |
| 65 | +// // Remove this line - it's not testing hook functionality |
| 66 | +// // expect(await Meteor.users.find().countAsync()).not.toBe(0) |
67 | 67 |
|
68 | | - // Meteor.users.find = MeteorUsersFind |
69 | | - // }) |
| 68 | +// Meteor.users.find = MeteorUsersFind |
| 69 | +// }) |
70 | 70 | // }) |
0 commit comments