@feathersjs/adapter-tests 5.0.0-pre.20 → 5.0.0-pre.24

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.
@@ -1,90 +1,90 @@
1
- export type AdapterTest = (name: AdapterTestName, runner: any) => void;
1
+ export type AdapterTest = (name: AdapterTestName, runner: any) => void
2
2
 
3
- export type AdapterBasicTest = (name: AdapterBasicTestName, runner: any) => void;
4
- export type AdapterMethodsTest = (name: AdapterMethodsTestName, runner: any) => void;
5
- export type AdapterSyntaxTest = (name: AdapterSyntaxTestName, runner: any) => void;
3
+ export type AdapterBasicTest = (name: AdapterBasicTestName, runner: any) => void
4
+ export type AdapterMethodsTest = (name: AdapterMethodsTestName, runner: any) => void
5
+ export type AdapterSyntaxTest = (name: AdapterSyntaxTestName, runner: any) => void
6
6
 
7
- export type AdapterTestName = AdapterBasicTestName | AdapterMethodsTestName | AdapterSyntaxTestName;
7
+ export type AdapterTestName = AdapterBasicTestName | AdapterMethodsTestName | AdapterSyntaxTestName
8
8
 
9
9
  export type AdapterBasicTestName =
10
- '.id' |
11
- '.options' |
12
- '.events' |
13
- '._get' |
14
- '._find' |
15
- '._create' |
16
- '._update' |
17
- '._patch' |
18
- '._remove'|
19
- '.$get' |
20
- '.$find' |
21
- '.$create' |
22
- '.$update' |
23
- '.$patch' |
24
- '.$remove';
10
+ | '.id'
11
+ | '.options'
12
+ | '.events'
13
+ | '._get'
14
+ | '._find'
15
+ | '._create'
16
+ | '._update'
17
+ | '._patch'
18
+ | '._remove'
19
+ | '.$get'
20
+ | '.$find'
21
+ | '.$create'
22
+ | '.$update'
23
+ | '.$patch'
24
+ | '.$remove'
25
25
 
26
26
  export type AdapterMethodsTestName =
27
- '.get' |
28
- '.get + $select' |
29
- '.get + id + query' |
30
- '.get + NotFound' |
31
- '.get + id + query id' |
32
- '.find' |
33
- '.remove' |
34
- '.remove + $select' |
35
- '.remove + id + query' |
36
- '.remove + multi' |
37
- '.remove + multi no pagination' |
38
- '.remove + id + query id' |
39
- '.update' |
40
- '.update + $select' |
41
- '.update + id + query' |
42
- '.update + NotFound' |
43
- '.update + query + NotFound' |
44
- '.update + id + query id' |
45
- '.patch' |
46
- '.patch + $select' |
47
- '.patch + id + query' |
48
- '.patch multiple' |
49
- '.patch multiple no pagination' |
50
- '.patch multi query same' |
51
- '.patch multi query changed' |
52
- '.patch + NotFound' |
53
- '.patch + query + NotFound' |
54
- '.patch + id + query id' |
55
- '.create' |
56
- '.create + $select' |
57
- '.create multi' |
58
- 'internal .find' |
59
- 'internal .get' |
60
- 'internal .create' |
61
- 'internal .update' |
62
- 'internal .patch' |
63
- 'internal .remove';
27
+ | '.get'
28
+ | '.get + $select'
29
+ | '.get + id + query'
30
+ | '.get + NotFound'
31
+ | '.get + id + query id'
32
+ | '.find'
33
+ | '.remove'
34
+ | '.remove + $select'
35
+ | '.remove + id + query'
36
+ | '.remove + multi'
37
+ | '.remove + multi no pagination'
38
+ | '.remove + id + query id'
39
+ | '.update'
40
+ | '.update + $select'
41
+ | '.update + id + query'
42
+ | '.update + NotFound'
43
+ | '.update + query + NotFound'
44
+ | '.update + id + query id'
45
+ | '.patch'
46
+ | '.patch + $select'
47
+ | '.patch + id + query'
48
+ | '.patch multiple'
49
+ | '.patch multiple no pagination'
50
+ | '.patch multi query same'
51
+ | '.patch multi query changed'
52
+ | '.patch + NotFound'
53
+ | '.patch + query + NotFound'
54
+ | '.patch + id + query id'
55
+ | '.create'
56
+ | '.create + $select'
57
+ | '.create multi'
58
+ | 'internal .find'
59
+ | 'internal .get'
60
+ | 'internal .create'
61
+ | 'internal .update'
62
+ | 'internal .patch'
63
+ | 'internal .remove'
64
64
 
65
65
  export type AdapterSyntaxTestName =
66
- '.find + equal' |
67
- '.find + equal multiple' |
68
- '.find + $sort' |
69
- '.find + $sort + string' |
70
- '.find + $limit' |
71
- '.find + $limit 0' |
72
- '.find + $skip' |
73
- '.find + $select' |
74
- '.find + $or' |
75
- '.find + $in' |
76
- '.find + $nin' |
77
- '.find + $lt' |
78
- '.find + $lte' |
79
- '.find + $gt' |
80
- '.find + $gte' |
81
- '.find + $ne' |
82
- '.find + $gt + $lt + $sort' |
83
- '.find + $or nested + $sort' |
84
- 'params.adapter + paginate' |
85
- 'params.adapter + multi' |
86
- '.find + paginate' |
87
- '.find + paginate + query' |
88
- '.find + paginate + $limit + $skip' |
89
- '.find + paginate + $limit 0' |
90
- '.find + paginate + params';
66
+ | '.find + equal'
67
+ | '.find + equal multiple'
68
+ | '.find + $sort'
69
+ | '.find + $sort + string'
70
+ | '.find + $limit'
71
+ | '.find + $limit 0'
72
+ | '.find + $skip'
73
+ | '.find + $select'
74
+ | '.find + $or'
75
+ | '.find + $in'
76
+ | '.find + $nin'
77
+ | '.find + $lt'
78
+ | '.find + $lte'
79
+ | '.find + $gt'
80
+ | '.find + $gte'
81
+ | '.find + $ne'
82
+ | '.find + $gt + $lt + $sort'
83
+ | '.find + $or nested + $sort'
84
+ | 'params.adapter + paginate'
85
+ | 'params.adapter + multi'
86
+ | '.find + paginate'
87
+ | '.find + paginate + query'
88
+ | '.find + paginate + $limit + $skip'
89
+ | '.find + paginate + $limit 0'
90
+ | '.find + paginate + params'
package/src/index.ts CHANGED
@@ -1,55 +1,57 @@
1
1
  /* eslint-disable no-console */
2
- import basicTests from './basic';
3
- import { AdapterTestName } from './declarations';
4
- import methodTests from './methods';
5
- import syntaxTests from './syntax';
2
+ import basicTests from './basic'
3
+ import { AdapterTestName } from './declarations'
4
+ import methodTests from './methods'
5
+ import syntaxTests from './syntax'
6
6
 
7
7
  const adapterTests = (testNames: AdapterTestName[]) => {
8
8
  return (app: any, errors: any, serviceName: any, idProp = 'id') => {
9
9
  if (!serviceName) {
10
- throw new Error('You must pass a service name');
10
+ throw new Error('You must pass a service name')
11
11
  }
12
12
 
13
- const skippedTests: AdapterTestName[] = [];
14
- const allTests: AdapterTestName[] = [];
13
+ const skippedTests: AdapterTestName[] = []
14
+ const allTests: AdapterTestName[] = []
15
15
 
16
16
  const test = (name: AdapterTestName, runner: any) => {
17
- const skip = !testNames.includes(name);
18
- const its = skip ? it.skip : it;
17
+ const skip = !testNames.includes(name)
18
+ const its = skip ? it.skip : it
19
19
 
20
20
  if (skip) {
21
- skippedTests.push(name);
21
+ skippedTests.push(name)
22
22
  }
23
23
 
24
- allTests.push(name);
24
+ allTests.push(name)
25
25
 
26
- its(name, runner);
27
- };
26
+ its(name, runner)
27
+ }
28
28
 
29
29
  describe(`Adapter tests for '${serviceName}' service with '${idProp}' id property`, () => {
30
30
  after(() => {
31
- testNames.forEach(name => {
31
+ testNames.forEach((name) => {
32
32
  if (!allTests.includes(name)) {
33
- console.error(`WARNING: '${name}' test is not part of the test suite`);
33
+ console.error(`WARNING: '${name}' test is not part of the test suite`)
34
34
  }
35
- });
35
+ })
36
36
  if (skippedTests.length) {
37
- console.log(`\nSkipped the following ${skippedTests.length} Feathers adapter test(s) out of ${allTests.length} total:`);
38
- console.log(JSON.stringify(skippedTests, null, ' '));
37
+ console.log(
38
+ `\nSkipped the following ${skippedTests.length} Feathers adapter test(s) out of ${allTests.length} total:`
39
+ )
40
+ console.log(JSON.stringify(skippedTests, null, ' '))
39
41
  }
40
- });
42
+ })
41
43
 
42
- basicTests(test, app, errors, serviceName, idProp);
43
- methodTests(test, app, errors, serviceName, idProp);
44
- syntaxTests(test, app, errors, serviceName, idProp);
45
- });
46
- };
47
- };
44
+ basicTests(test, app, errors, serviceName, idProp)
45
+ methodTests(test, app, errors, serviceName, idProp)
46
+ syntaxTests(test, app, errors, serviceName, idProp)
47
+ })
48
+ }
49
+ }
48
50
 
49
51
  export * from './declarations'
50
52
 
51
- export default adapterTests;
53
+ export default adapterTests
52
54
 
53
55
  if (typeof module !== 'undefined') {
54
- module.exports = Object.assign(adapterTests, module.exports);
56
+ module.exports = Object.assign(adapterTests, module.exports)
55
57
  }