Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(adapter-tests): Ensure multi tests can run standalone #2608

Merged
merged 1 commit into from
Apr 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/adapter-tests/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ export default (test: AdapterMethodsTest, app: any, _errors: any, serviceName: s

test('.patch multi query same', async () => {
const service = app.service(serviceName);
const multiBefore = service.options.multi;

service.options.multi = true;

const params = {
query: { age: { $lt: 10 } }
};
Expand All @@ -480,10 +484,16 @@ export default (test: AdapterMethodsTest, app: any, _errors: any, serviceName: s

await service.remove(dave[idProp]);
await service.remove(david[idProp]);

service.options.multi = multiBefore;
});

test('.patch multi query changed', async () => {
const service = app.service(serviceName);
const multiBefore = service.options.multi;

service.options.multi = true;

const params = {
query: { age: 10 }
};
Expand All @@ -508,6 +518,8 @@ export default (test: AdapterMethodsTest, app: any, _errors: any, serviceName: s

await service.remove(dave[idProp]);
await service.remove(david[idProp]);

service.options.multi = multiBefore;
});

test('.patch + NotFound', async () => {
Expand Down