@feathersjs/client 5.0.0-pre.0 → 5.0.0-pre.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +2 -2
  3. package/dist/core.d.ts +1 -0
  4. package/dist/core.js +1861 -3627
  5. package/dist/core.js.map +1 -1
  6. package/dist/core.min.js +1 -1
  7. package/dist/feathers.d.ts +8 -0
  8. package/dist/feathers.js +5106 -5755
  9. package/dist/feathers.js.map +1 -1
  10. package/dist/feathers.min.js +1 -1
  11. package/package.json +44 -38
  12. package/src/core.ts +1 -0
  13. package/src/feathers.ts +13 -0
  14. package/.babelrc +0 -8
  15. package/.cache/lasso/default/6a3076a5/dependencyFingerprints/cache +0 -0
  16. package/.cache/lasso/default/6a3076a5/key +0 -1
  17. package/.cache/lasso/default/6a3076a5/lasso-require/inspect-/5d47a286cdceb98f64bf9128488dd355fde40e81/cache +0 -0
  18. package/.cache/lasso/default/7be4a25c/dependencyFingerprints/cache +0 -0
  19. package/.cache/lasso/default/7be4a25c/key +0 -1
  20. package/.cache/lasso/default/7be4a25c/lasso-require/inspect/cache +0 -0
  21. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/filter-query.js +0 -1998
  22. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/index.js +0 -694
  23. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/service.js +0 -1636
  24. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/sort.js +0 -2259
  25. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/filter-query.js +0 -98
  26. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/index.js +0 -37
  27. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/service.js +0 -94
  28. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/sort.js +0 -112
  29. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test-run.js +0 -1
  30. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test.js +0 -1037
  31. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/dist/feathers.js +0 -78377
  32. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test-run.js +0 -1
  33. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test.js +0 -102
  34. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/dist/feathers.js +0 -5231
  35. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/hooks.js +0 -2626
  36. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/index.js +0 -540
  37. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/utils.js +0 -1991
  38. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/hooks.js +0 -170
  39. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/index.js +0 -17
  40. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/utils.js +0 -102
  41. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.0/lib/index.js +0 -2262
  42. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.1/lib/index.js +0 -251
  43. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.0/lib/client.js +0 -1506
  44. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.1/lib/client.js +0 -83
  45. package/.mocha-puppeteer/test-page/assert$1.5.0/assert.js +0 -508
  46. package/.mocha-puppeteer/test-page/debug$4.1.1/src/browser.js +0 -266
  47. package/.mocha-puppeteer/test-page/debug$4.1.1/src/common.js +0 -268
  48. package/.mocha-puppeteer/test-page/feathers-memory$4.1.0/lib/index.js +0 -143
  49. package/.mocha-puppeteer/test-page/inherits$2.0.1/inherits_browser.js +0 -25
  50. package/.mocha-puppeteer/test-page/lasso-modules-client$2.0.5/src/index.js +0 -592
  51. package/.mocha-puppeteer/test-page/lasso-modules-meta.js +0 -28
  52. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot-run.js +0 -1
  53. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot.js +0 -95
  54. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot-run.js +0 -1
  55. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot.js +0 -95
  56. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot-run.js +0 -1
  57. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot.js +0 -3
  58. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.css +0 -326
  59. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.js +0 -16590
  60. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js +0 -1
  61. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests.js +0 -53
  62. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup-run.js +0 -1
  63. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup.js +0 -10
  64. package/.mocha-puppeteer/test-page/ms$2.1.2/index.js +0 -164
  65. package/.mocha-puppeteer/test-page/object-assign$4.1.1/index.js +0 -92
  66. package/.mocha-puppeteer/test-page/process$0.11.10/browser.js +0 -186
  67. package/.mocha-puppeteer/test-page/sift$8.5.1/lib/index.js +0 -738
  68. package/.mocha-puppeteer/test-page/superagent$3.8.3/superagent.js +0 -2035
  69. package/.mocha-puppeteer/test-page/util$0.10.3/support/isBufferBrowser.js +0 -7
  70. package/.mocha-puppeteer/test-page/util$0.10.3/util.js +0 -588
  71. package/.nyc_output/coverage.json +0 -1
  72. package/authentication.js +0 -1
  73. package/dist/authentication.js +0 -2242
  74. package/dist/authentication.js.map +0 -1
  75. package/dist/authentication.min.js +0 -1
  76. package/dist/rest.js +0 -3287
  77. package/dist/rest.js.map +0 -1
  78. package/dist/rest.min.js +0 -1
  79. package/dist/socketio.js +0 -2384
  80. package/dist/socketio.js.map +0 -1
  81. package/dist/socketio.min.js +0 -1
  82. package/index.d.ts +0 -23
  83. package/index.js +0 -1
  84. package/rest.js +0 -1
  85. package/socketio.js +0 -1
  86. package/webpack.config.js +0 -69
@@ -1,1037 +0,0 @@
1
- $_mod.def("/@feathersjs/client$4.5.0/browser/test", function(require, exports, module, __filename, __dirname) { var cov_hmx8huv5g = function () {
2
- var path = 'test.js',
3
- hash = '292e1b9d6dfbb03a8dac971e01da815a94e4715f',
4
- Function = function () {}.constructor,
5
- global = new Function('return this')(),
6
- gcv = '__coverage__',
7
- coverageData = {
8
- path: 'test.js',
9
- statementMap: {
10
- '0': {
11
- start: {
12
- line: 1,
13
- column: 15
14
- },
15
- end: {
16
- line: 1,
17
- column: 32
18
- }
19
- },
20
- '1': {
21
- start: {
22
- line: 2,
23
- column: 18
24
- },
25
- end: {
26
- line: 2,
27
- column: 57
28
- }
29
- },
30
- '2': {
31
- start: {
32
- line: 3,
33
- column: 15
34
- },
35
- end: {
36
- line: 3,
37
- column: 41
38
- }
39
- },
40
- '3': {
41
- start: {
42
- line: 5,
43
- column: 17
44
- },
45
- end: {
46
- line: 5,
47
- column: 44
48
- }
49
- },
50
- '4': {
51
- start: {
52
- line: 10,
53
- column: 4
54
- },
55
- end: {
56
- line: 12,
57
- column: 5
58
- }
59
- },
60
- '5': {
61
- start: {
62
- line: 11,
63
- column: 6
64
- },
65
- end: {
66
- line: 11,
67
- column: 63
68
- }
69
- },
70
- '6': {
71
- start: {
72
- line: 14,
73
- column: 4
74
- },
75
- end: {
76
- line: 16,
77
- column: 6
78
- }
79
- },
80
- '7': {
81
- start: {
82
- line: 15,
83
- column: 6
84
- },
85
- end: {
86
- line: 15,
87
- column: 50
88
- }
89
- },
90
- '8': {
91
- start: {
92
- line: 20,
93
- column: 0
94
- },
95
- end: {
96
- line: 100,
97
- column: 3
98
- }
99
- },
100
- '9': {
101
- start: {
102
- line: 21,
103
- column: 14
104
- },
105
- end: {
106
- line: 35,
107
- column: 7
108
- }
109
- },
110
- '10': {
111
- start: {
112
- line: 24,
113
- column: 8
114
- },
115
- end: {
116
- line: 26,
117
- column: 11
118
- }
119
- },
120
- '11': {
121
- start: {
122
- line: 30,
123
- column: 8
124
- },
125
- end: {
126
- line: 30,
127
- column: 37
128
- }
129
- },
130
- '12': {
131
- start: {
132
- line: 37,
133
- column: 2
134
- },
135
- end: {
136
- line: 48,
137
- column: 5
138
- }
139
- },
140
- '13': {
141
- start: {
142
- line: 40,
143
- column: 8
144
- },
145
- end: {
146
- line: 40,
147
- column: 30
148
- }
149
- },
150
- '14': {
151
- start: {
152
- line: 45,
153
- column: 8
154
- },
155
- end: {
156
- line: 45,
157
- column: 31
158
- }
159
- },
160
- '15': {
161
- start: {
162
- line: 50,
163
- column: 2
164
- },
165
- end: {
166
- line: 53,
167
- column: 6
168
- }
169
- },
170
- '16': {
171
- start: {
172
- line: 50,
173
- column: 15
174
- },
175
- end: {
176
- line: 53,
177
- column: 4
178
- }
179
- },
180
- '17': {
181
- start: {
182
- line: 55,
183
- column: 2
184
- },
185
- end: {
186
- line: 55,
187
- column: 49
188
- }
189
- },
190
- '18': {
191
- start: {
192
- line: 55,
193
- column: 14
194
- },
195
- end: {
196
- line: 55,
197
- column: 47
198
- }
199
- },
200
- '19': {
201
- start: {
202
- line: 57,
203
- column: 2
204
- },
205
- end: {
206
- line: 57,
207
- column: 26
208
- }
209
- },
210
- '20': {
211
- start: {
212
- line: 59,
213
- column: 2
214
- },
215
- end: {
216
- line: 99,
217
- column: 5
218
- }
219
- },
220
- '21': {
221
- start: {
222
- line: 60,
223
- column: 4
224
- },
225
- end: {
226
- line: 69,
227
- column: 7
228
- }
229
- },
230
- '22': {
231
- start: {
232
- line: 61,
233
- column: 6
234
- },
235
- end: {
236
- line: 68,
237
- column: 21
238
- }
239
- },
240
- '23': {
241
- start: {
242
- line: 62,
243
- column: 8
244
- },
245
- end: {
246
- line: 66,
247
- column: 11
248
- }
249
- },
250
- '24': {
251
- start: {
252
- line: 67,
253
- column: 8
254
- },
255
- end: {
256
- line: 67,
257
- column: 15
258
- }
259
- },
260
- '25': {
261
- start: {
262
- line: 71,
263
- column: 4
264
- },
265
- end: {
266
- line: 83,
267
- column: 7
268
- }
269
- },
270
- '26': {
271
- start: {
272
- line: 72,
273
- column: 24
274
- },
275
- end: {
276
- line: 72,
277
- column: 48
278
- }
279
- },
280
- '27': {
281
- start: {
282
- line: 74,
283
- column: 6
284
- },
285
- end: {
286
- line: 80,
287
- column: 9
288
- }
289
- },
290
- '28': {
291
- start: {
292
- line: 75,
293
- column: 8
294
- },
295
- end: {
296
- line: 78,
297
- column: 11
298
- }
299
- },
300
- '29': {
301
- start: {
302
- line: 79,
303
- column: 8
304
- },
305
- end: {
306
- line: 79,
307
- column: 15
308
- }
309
- },
310
- '30': {
311
- start: {
312
- line: 82,
313
- column: 6
314
- },
315
- end: {
316
- line: 82,
317
- column: 53
318
- }
319
- },
320
- '31': {
321
- start: {
322
- line: 85,
323
- column: 4
324
- },
325
- end: {
326
- line: 98,
327
- column: 7
328
- }
329
- },
330
- '32': {
331
- start: {
332
- line: 86,
333
- column: 6
334
- },
335
- end: {
336
- line: 97,
337
- column: 9
338
- }
339
- },
340
- '33': {
341
- start: {
342
- line: 87,
343
- column: 8
344
- },
345
- end: {
346
- line: 96,
347
- column: 11
348
- }
349
- },
350
- '34': {
351
- start: {
352
- line: 88,
353
- column: 10
354
- },
355
- end: {
356
- line: 95,
357
- column: 13
358
- }
359
- },
360
- '35': {
361
- start: {
362
- line: 89,
363
- column: 26
364
- },
365
- end: {
366
- line: 89,
367
- column: 60
368
- }
369
- },
370
- '36': {
371
- start: {
372
- line: 90,
373
- column: 12
374
- },
375
- end: {
376
- line: 90,
377
- column: 42
378
- }
379
- },
380
- '37': {
381
- start: {
382
- line: 91,
383
- column: 12
384
- },
385
- end: {
386
- line: 91,
387
- column: 49
388
- }
389
- },
390
- '38': {
391
- start: {
392
- line: 92,
393
- column: 12
394
- },
395
- end: {
396
- line: 92,
397
- column: 59
398
- }
399
- },
400
- '39': {
401
- start: {
402
- line: 93,
403
- column: 12
404
- },
405
- end: {
406
- line: 93,
407
- column: 78
408
- }
409
- },
410
- '40': {
411
- start: {
412
- line: 94,
413
- column: 12
414
- },
415
- end: {
416
- line: 94,
417
- column: 79
418
- }
419
- }
420
- },
421
- fnMap: {
422
- '0': {
423
- name: '(anonymous_0)',
424
- decl: {
425
- start: {
426
- line: 9,
427
- column: 2
428
- },
429
- end: {
430
- line: 9,
431
- column: 3
432
- }
433
- },
434
- loc: {
435
- start: {
436
- line: 9,
437
- column: 19
438
- },
439
- end: {
440
- line: 17,
441
- column: 3
442
- }
443
- },
444
- line: 9
445
- },
446
- '1': {
447
- name: '(anonymous_1)',
448
- decl: {
449
- start: {
450
- line: 14,
451
- column: 30
452
- },
453
- end: {
454
- line: 14,
455
- column: 31
456
- }
457
- },
458
- loc: {
459
- start: {
460
- line: 15,
461
- column: 6
462
- },
463
- end: {
464
- line: 15,
465
- column: 50
466
- }
467
- },
468
- line: 15
469
- },
470
- '2': {
471
- name: '(anonymous_2)',
472
- decl: {
473
- start: {
474
- line: 20,
475
- column: 48
476
- },
477
- end: {
478
- line: 20,
479
- column: 49
480
- }
481
- },
482
- loc: {
483
- start: {
484
- line: 20,
485
- column: 60
486
- },
487
- end: {
488
- line: 100,
489
- column: 1
490
- }
491
- },
492
- line: 20
493
- },
494
- '3': {
495
- name: '(anonymous_3)',
496
- decl: {
497
- start: {
498
- line: 50,
499
- column: 9
500
- },
501
- end: {
502
- line: 50,
503
- column: 10
504
- }
505
- },
506
- loc: {
507
- start: {
508
- line: 50,
509
- column: 15
510
- },
511
- end: {
512
- line: 53,
513
- column: 4
514
- }
515
- },
516
- line: 50
517
- },
518
- '4': {
519
- name: '(anonymous_4)',
520
- decl: {
521
- start: {
522
- line: 55,
523
- column: 8
524
- },
525
- end: {
526
- line: 55,
527
- column: 9
528
- }
529
- },
530
- loc: {
531
- start: {
532
- line: 55,
533
- column: 14
534
- },
535
- end: {
536
- line: 55,
537
- column: 47
538
- }
539
- },
540
- line: 55
541
- },
542
- '5': {
543
- name: '(anonymous_5)',
544
- decl: {
545
- start: {
546
- line: 59,
547
- column: 45
548
- },
549
- end: {
550
- line: 59,
551
- column: 46
552
- }
553
- },
554
- loc: {
555
- start: {
556
- line: 59,
557
- column: 51
558
- },
559
- end: {
560
- line: 99,
561
- column: 3
562
- }
563
- },
564
- line: 59
565
- },
566
- '6': {
567
- name: '(anonymous_6)',
568
- decl: {
569
- start: {
570
- line: 60,
571
- column: 53
572
- },
573
- end: {
574
- line: 60,
575
- column: 54
576
- }
577
- },
578
- loc: {
579
- start: {
580
- line: 60,
581
- column: 61
582
- },
583
- end: {
584
- line: 69,
585
- column: 5
586
- }
587
- },
588
- line: 60
589
- },
590
- '7': {
591
- name: '(anonymous_7)',
592
- decl: {
593
- start: {
594
- line: 61,
595
- column: 50
596
- },
597
- end: {
598
- line: 61,
599
- column: 51
600
- }
601
- },
602
- loc: {
603
- start: {
604
- line: 61,
605
- column: 58
606
- },
607
- end: {
608
- line: 68,
609
- column: 7
610
- }
611
- },
612
- line: 61
613
- },
614
- '8': {
615
- name: '(anonymous_8)',
616
- decl: {
617
- start: {
618
- line: 71,
619
- column: 37
620
- },
621
- end: {
622
- line: 71,
623
- column: 38
624
- }
625
- },
626
- loc: {
627
- start: {
628
- line: 71,
629
- column: 45
630
- },
631
- end: {
632
- line: 83,
633
- column: 5
634
- }
635
- },
636
- line: 71
637
- },
638
- '9': {
639
- name: '(anonymous_9)',
640
- decl: {
641
- start: {
642
- line: 74,
643
- column: 32
644
- },
645
- end: {
646
- line: 74,
647
- column: 33
648
- }
649
- },
650
- loc: {
651
- start: {
652
- line: 74,
653
- column: 40
654
- },
655
- end: {
656
- line: 80,
657
- column: 7
658
- }
659
- },
660
- line: 74
661
- },
662
- '10': {
663
- name: '(anonymous_10)',
664
- decl: {
665
- start: {
666
- line: 85,
667
- column: 32
668
- },
669
- end: {
670
- line: 85,
671
- column: 33
672
- }
673
- },
674
- loc: {
675
- start: {
676
- line: 85,
677
- column: 38
678
- },
679
- end: {
680
- line: 98,
681
- column: 5
682
- }
683
- },
684
- line: 85
685
- },
686
- '11': {
687
- name: '(anonymous_11)',
688
- decl: {
689
- start: {
690
- line: 86,
691
- column: 44
692
- },
693
- end: {
694
- line: 86,
695
- column: 45
696
- }
697
- },
698
- loc: {
699
- start: {
700
- line: 86,
701
- column: 50
702
- },
703
- end: {
704
- line: 97,
705
- column: 7
706
- }
707
- },
708
- line: 86
709
- },
710
- '12': {
711
- name: '(anonymous_12)',
712
- decl: {
713
- start: {
714
- line: 87,
715
- column: 43
716
- },
717
- end: {
718
- line: 87,
719
- column: 44
720
- }
721
- },
722
- loc: {
723
- start: {
724
- line: 87,
725
- column: 49
726
- },
727
- end: {
728
- line: 96,
729
- column: 9
730
- }
731
- },
732
- line: 87
733
- },
734
- '13': {
735
- name: '(anonymous_13)',
736
- decl: {
737
- start: {
738
- line: 88,
739
- column: 30
740
- },
741
- end: {
742
- line: 88,
743
- column: 31
744
- }
745
- },
746
- loc: {
747
- start: {
748
- line: 88,
749
- column: 36
750
- },
751
- end: {
752
- line: 95,
753
- column: 11
754
- }
755
- },
756
- line: 88
757
- }
758
- },
759
- branchMap: {
760
- '0': {
761
- loc: {
762
- start: {
763
- line: 10,
764
- column: 4
765
- },
766
- end: {
767
- line: 12,
768
- column: 5
769
- }
770
- },
771
- type: 'if',
772
- locations: [{
773
- start: {
774
- line: 10,
775
- column: 4
776
- },
777
- end: {
778
- line: 12,
779
- column: 5
780
- }
781
- }, {
782
- start: {
783
- line: 10,
784
- column: 4
785
- },
786
- end: {
787
- line: 12,
788
- column: 5
789
- }
790
- }],
791
- line: 10
792
- }
793
- },
794
- s: {
795
- '0': 0,
796
- '1': 0,
797
- '2': 0,
798
- '3': 0,
799
- '4': 0,
800
- '5': 0,
801
- '6': 0,
802
- '7': 0,
803
- '8': 0,
804
- '9': 0,
805
- '10': 0,
806
- '11': 0,
807
- '12': 0,
808
- '13': 0,
809
- '14': 0,
810
- '15': 0,
811
- '16': 0,
812
- '17': 0,
813
- '18': 0,
814
- '19': 0,
815
- '20': 0,
816
- '21': 0,
817
- '22': 0,
818
- '23': 0,
819
- '24': 0,
820
- '25': 0,
821
- '26': 0,
822
- '27': 0,
823
- '28': 0,
824
- '29': 0,
825
- '30': 0,
826
- '31': 0,
827
- '32': 0,
828
- '33': 0,
829
- '34': 0,
830
- '35': 0,
831
- '36': 0,
832
- '37': 0,
833
- '38': 0,
834
- '39': 0,
835
- '40': 0
836
- },
837
- f: {
838
- '0': 0,
839
- '1': 0,
840
- '2': 0,
841
- '3': 0,
842
- '4': 0,
843
- '5': 0,
844
- '6': 0,
845
- '7': 0,
846
- '8': 0,
847
- '9': 0,
848
- '10': 0,
849
- '11': 0,
850
- '12': 0,
851
- '13': 0
852
- },
853
- b: {
854
- '0': [0, 0]
855
- },
856
- _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
857
- },
858
- coverage = global[gcv] || (global[gcv] = {});
859
-
860
- if (coverage[path] && coverage[path].hash === hash) {
861
- return coverage[path];
862
- }
863
-
864
- coverageData.hash = hash;
865
- return coverage[path] = coverageData;
866
- }();
867
-
868
- const assert = (cov_hmx8huv5g.s[0]++, require('/assert$1.5.0/assert'/*'assert'*/));
869
- const baseTests = (cov_hmx8huv5g.s[1]++, require('/@feathersjs/tests$4.5.0/lib/client'/*'@feathersjs/tests/lib/client'*/));
870
- const memory = (cov_hmx8huv5g.s[2]++, require('/feathers-memory$4.1.0/lib/index'/*'feathers-memory'*/));
871
-
872
- const feathers = (cov_hmx8huv5g.s[3]++, require('/@feathersjs/client$4.5.0/dist/feathers'/*'../dist/feathers'*/));
873
-
874
- // Create an in-memory CRUD service for our Todos
875
- class TodoService extends (memory.Service) {
876
- get(id, params) {
877
- cov_hmx8huv5g.f[0]++;
878
- cov_hmx8huv5g.s[4]++;
879
-
880
- if (params.query.error) {
881
- cov_hmx8huv5g.b[0][0]++;
882
- cov_hmx8huv5g.s[5]++;
883
-
884
- return Promise.reject(new Error('Something went wrong'));
885
- } else {
886
- cov_hmx8huv5g.b[0][1]++;
887
- }
888
-
889
- cov_hmx8huv5g.s[6]++;
890
- return super.get(id).then(data => {
891
- cov_hmx8huv5g.f[1]++;
892
- cov_hmx8huv5g.s[7]++;
893
- return Object.assign({ query: params.query }, data);
894
- });
895
- }
896
- }
897
-
898
- cov_hmx8huv5g.s[8]++;
899
- describe('Feathers client browser smoke tests', function () {
900
- cov_hmx8huv5g.f[2]++;
901
-
902
- const app = (cov_hmx8huv5g.s[9]++, feathers().use('/myservice', {
903
- get(id) {
904
- cov_hmx8huv5g.s[10]++;
905
-
906
- return Promise.resolve({
907
- id, description: `You have to do ${id}!`
908
- });
909
- },
910
-
911
- create(data) {
912
- cov_hmx8huv5g.s[11]++;
913
-
914
- return Promise.resolve(data);
915
- }
916
- }).use('/todos', new TodoService({
917
- multi: true
918
- })));
919
-
920
- cov_hmx8huv5g.s[12]++;
921
- app.service('myservice').hooks({
922
- before: {
923
- create(hook) {
924
- cov_hmx8huv5g.s[13]++;
925
-
926
- hook.data.hook = true;
927
- }
928
- },
929
- after: {
930
- get(hook) {
931
- cov_hmx8huv5g.s[14]++;
932
-
933
- hook.result.ran = true;
934
- }
935
- }
936
- });
937
-
938
- cov_hmx8huv5g.s[15]++;
939
- before(() => {
940
- cov_hmx8huv5g.f[3]++;
941
- cov_hmx8huv5g.s[16]++;
942
- return app.service('todos').create({
943
- text: 'some todo',
944
- complete: false
945
- });
946
- });
947
-
948
- cov_hmx8huv5g.s[17]++;
949
- after(() => {
950
- cov_hmx8huv5g.f[4]++;
951
- cov_hmx8huv5g.s[18]++;
952
- return app.service('todos').remove(null);
953
- });
954
-
955
- cov_hmx8huv5g.s[19]++;
956
- baseTests(app, 'todos');
957
-
958
- cov_hmx8huv5g.s[20]++;
959
- describe('Client side hooks and services', () => {
960
- cov_hmx8huv5g.f[5]++;
961
- cov_hmx8huv5g.s[21]++;
962
-
963
- it('initialized myservice and works with hooks', done => {
964
- cov_hmx8huv5g.f[6]++;
965
- cov_hmx8huv5g.s[22]++;
966
-
967
- app.service('myservice').get('dishes').then(todo => {
968
- cov_hmx8huv5g.f[7]++;
969
- cov_hmx8huv5g.s[23]++;
970
-
971
- assert.deepEqual(todo, {
972
- id: 'dishes',
973
- description: 'You have to do dishes!',
974
- ran: true
975
- });
976
- cov_hmx8huv5g.s[24]++;
977
- done();
978
- }).catch(done);
979
- });
980
-
981
- cov_hmx8huv5g.s[25]++;
982
- it('create and event with hook', done => {
983
- cov_hmx8huv5g.f[8]++;
984
-
985
- const myservice = (cov_hmx8huv5g.s[26]++, app.service('myservice'));
986
-
987
- cov_hmx8huv5g.s[27]++;
988
- myservice.once('created', data => {
989
- cov_hmx8huv5g.f[9]++;
990
- cov_hmx8huv5g.s[28]++;
991
-
992
- assert.deepEqual(data, {
993
- description: 'Test todo',
994
- hook: true
995
- });
996
- cov_hmx8huv5g.s[29]++;
997
- done();
998
- });
999
-
1000
- cov_hmx8huv5g.s[30]++;
1001
- myservice.create({ description: 'Test todo' });
1002
- });
1003
-
1004
- cov_hmx8huv5g.s[31]++;
1005
- describe('Feathers Errors', () => {
1006
- cov_hmx8huv5g.f[10]++;
1007
- cov_hmx8huv5g.s[32]++;
1008
-
1009
- describe('successful error creation', () => {
1010
- cov_hmx8huv5g.f[11]++;
1011
- cov_hmx8huv5g.s[33]++;
1012
-
1013
- describe('without custom message', () => {
1014
- cov_hmx8huv5g.f[12]++;
1015
- cov_hmx8huv5g.s[34]++;
1016
-
1017
- it('default error', () => {
1018
- cov_hmx8huv5g.f[13]++;
1019
-
1020
- const error = (cov_hmx8huv5g.s[35]++, new feathers.errors.GeneralError());
1021
- cov_hmx8huv5g.s[36]++;
1022
- assert.equal(error.code, 500);
1023
- cov_hmx8huv5g.s[37]++;
1024
- assert.equal(error.message, 'Error');
1025
- cov_hmx8huv5g.s[38]++;
1026
- assert.equal(error.className, 'general-error');
1027
- cov_hmx8huv5g.s[39]++;
1028
- assert.equal(error instanceof feathers.errors.GeneralError, true);
1029
- cov_hmx8huv5g.s[40]++;
1030
- assert.equal(error instanceof feathers.errors.FeathersError, true);
1031
- });
1032
- });
1033
- });
1034
- });
1035
- });
1036
- });
1037
- });