@feathersjs/adapter-tests 4.5.2 → 4.5.12
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.
- package/CHANGELOG.md +38 -0
- package/LICENSE +1 -1
- package/lib/basic.d.ts +2 -0
- package/lib/basic.js +42 -51
- package/lib/basic.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +46 -44
- package/lib/index.js.map +1 -0
- package/lib/methods.d.ts +2 -0
- package/lib/methods.js +469 -528
- package/lib/methods.js.map +1 -0
- package/lib/syntax.d.ts +2 -0
- package/lib/syntax.js +296 -337
- package/lib/syntax.js.map +1 -0
- package/package.json +19 -9
- package/src/basic.ts +53 -0
- package/src/index.ts +53 -0
- package/src/methods.ts +600 -0
- package/src/syntax.ts +342 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.5.12](https://github.com/feathersjs/databases/compare/v4.5.11...v4.5.12) (2022-01-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Update all dependencies for crow release ([#2520](https://github.com/feathersjs/databases/issues/2520)) ([1c63e6b](https://github.com/feathersjs/databases/commit/1c63e6be37ff85edbe8dd318415ca6919864c033))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [4.5.11](https://github.com/feathersjs/databases/compare/v4.5.10...v4.5.11) (2020-12-05)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @feathersjs/adapter-tests
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [4.5.4](https://github.com/feathersjs/databases/compare/@feathersjs/adapter-tests@4.5.3...@feathersjs/adapter-tests@4.5.4) (2020-09-27)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @feathersjs/adapter-tests
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 4.5.3 (2020-09-24)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **adapter-tests:** Update multi patch + query tests ([#5](https://github.com/feathersjs/databases/issues/5)) ([84f1fe4](https://github.com/feathersjs/databases/commit/84f1fe4f13dc3a26891e43b965f75d08243f6c6f))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package @feathersjs/adapter-tests
|
package/LICENSE
CHANGED
package/lib/basic.d.ts
ADDED
package/lib/basic.js
CHANGED
|
@@ -1,53 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'id
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
test('._patch', () => {
|
|
45
|
-
assert.strictEqual(typeof service._patch, 'function');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test('._remove', () => {
|
|
49
|
-
assert.strictEqual(typeof service._remove, 'function');
|
|
50
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const assert_1 = __importDefault(require("assert"));
|
|
7
|
+
exports.default = (test, app, _errors, serviceName, idProp) => {
|
|
8
|
+
describe('Basic Functionality', () => {
|
|
9
|
+
let service;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
service = app.service(serviceName);
|
|
12
|
+
});
|
|
13
|
+
it('.id', () => {
|
|
14
|
+
assert_1.default.strictEqual(service.id, idProp, 'id property is set to expected name');
|
|
15
|
+
});
|
|
16
|
+
test('.options', () => {
|
|
17
|
+
assert_1.default.ok(service.options, 'Options are available in service.options');
|
|
18
|
+
});
|
|
19
|
+
test('.events', () => {
|
|
20
|
+
assert_1.default.ok(service.events.includes('testing'), 'service.events is set and includes "testing"');
|
|
21
|
+
});
|
|
22
|
+
describe('Raw Methods', () => {
|
|
23
|
+
test('._get', () => {
|
|
24
|
+
assert_1.default.strictEqual(typeof service._get, 'function');
|
|
25
|
+
});
|
|
26
|
+
test('._find', () => {
|
|
27
|
+
assert_1.default.strictEqual(typeof service._find, 'function');
|
|
28
|
+
});
|
|
29
|
+
test('._create', () => {
|
|
30
|
+
assert_1.default.strictEqual(typeof service._create, 'function');
|
|
31
|
+
});
|
|
32
|
+
test('._update', () => {
|
|
33
|
+
assert_1.default.strictEqual(typeof service._update, 'function');
|
|
34
|
+
});
|
|
35
|
+
test('._patch', () => {
|
|
36
|
+
assert_1.default.strictEqual(typeof service._patch, 'function');
|
|
37
|
+
});
|
|
38
|
+
test('._remove', () => {
|
|
39
|
+
assert_1.default.strictEqual(typeof service._remove, 'function');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
51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C,KAAK,EAAE,UAAU,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;gBACpB,gBAAM,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;gBACpB,gBAAM,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;gBACnB,gBAAM,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;gBACpB,gBAAM,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
6
|
/* tslint:disable:no-console */
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw new Error('You must pass a service name');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const skippedTests = [];
|
|
13
|
-
const allTests = [];
|
|
14
|
-
|
|
15
|
-
const test = (name, runner) => {
|
|
16
|
-
const skip = !testNames.includes(name);
|
|
17
|
-
const its = skip ? it.skip : it;
|
|
18
|
-
|
|
19
|
-
if (skip) {
|
|
20
|
-
skippedTests.push(name);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
allTests.push(name);
|
|
24
|
-
|
|
25
|
-
its(name, runner);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
describe(`Adapter tests for '${serviceName}' service with '${idProp}' id property`, () => {
|
|
29
|
-
after(() => {
|
|
30
|
-
console.log('\n');
|
|
31
|
-
testNames.forEach(name => {
|
|
32
|
-
if (!allTests.includes(name)) {
|
|
33
|
-
console.error(`WARNING: '${name}' test is not part of the test suite`);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
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, ' '));
|
|
7
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
8
|
+
const methods_1 = __importDefault(require("./methods"));
|
|
9
|
+
const syntax_1 = __importDefault(require("./syntax"));
|
|
10
|
+
const adapterTests = (testNames) => {
|
|
11
|
+
return (app, errors, serviceName, idProp = 'id') => {
|
|
12
|
+
if (!serviceName) {
|
|
13
|
+
throw new Error('You must pass a service name');
|
|
39
14
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
const skippedTests = [];
|
|
16
|
+
const allTests = [];
|
|
17
|
+
const test = (name, runner) => {
|
|
18
|
+
const skip = !testNames.includes(name);
|
|
19
|
+
const its = skip ? it.skip : it;
|
|
20
|
+
if (skip) {
|
|
21
|
+
skippedTests.push(name);
|
|
22
|
+
}
|
|
23
|
+
allTests.push(name);
|
|
24
|
+
its(name, runner);
|
|
25
|
+
};
|
|
26
|
+
describe(`Adapter tests for '${serviceName}' service with '${idProp}' id property`, () => {
|
|
27
|
+
after(() => {
|
|
28
|
+
console.log('\n');
|
|
29
|
+
testNames.forEach(name => {
|
|
30
|
+
if (!allTests.includes(name)) {
|
|
31
|
+
console.error(`WARNING: '${name}' test is not part of the test suite`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (skippedTests.length) {
|
|
35
|
+
console.log(`\nSkipped the following ${skippedTests.length} Feathers adapter test(s) out of ${allTests.length} total:`);
|
|
36
|
+
console.log(JSON.stringify(skippedTests, null, ' '));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
(0, basic_1.default)(test, app, errors, serviceName, idProp);
|
|
40
|
+
(0, methods_1.default)(test, app, errors, serviceName, idProp);
|
|
41
|
+
(0, syntax_1.default)(test, app, errors, serviceName, idProp);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
47
44
|
};
|
|
45
|
+
exports.default = adapterTests;
|
|
46
|
+
if (typeof module !== 'undefined') {
|
|
47
|
+
module.exports = adapterTests;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,oDAAiC;AACjC,wDAAoC;AACpC,sDAAmC;AAEnC,MAAM,YAAY,GAAG,CAAC,SAAmB,EAAE,EAAE;IAC3C,OAAO,CAAC,GAAQ,EAAE,MAAW,EAAE,WAAgB,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE;QAChE,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QAED,MAAM,YAAY,GAAa,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;YACzC,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACv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