Skip to content

Commit

Permalink
Return context from _before() (#4948)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Feb 25, 2021
1 parent 5057225 commit 6dcd01c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-bikes-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/test-utils': patch
---

Updated `multiAdapterRunners().before()` to return a `context` object when using `setupFromConfig()`.
8 changes: 5 additions & 3 deletions packages/test-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,13 @@ function _keystoneRunner(adapterName: AdapterName, tearDownFunction: () => Promi

function _before(adapterName: AdapterName) {
return async function (
setupKeystone: (adapterName: AdapterName) => Promise<{ keystone: Keystone<string>; app: any }>
setupKeystone: (
adapterName: AdapterName
) => Promise<{ keystone: Keystone<string>; app: any; context: any }>
) {
const { keystone, app } = await setupKeystone(adapterName);
const { keystone, context, app } = await setupKeystone(adapterName);
await keystone.connect();
return { keystone, app };
return { keystone, context, app };
};
}

Expand Down

1 comment on commit 6dcd01c

@vercel
Copy link

@vercel vercel bot commented on 6dcd01c Feb 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.