minimonolith 0.22.0 → 0.22.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minimonolith",
3
3
  "type": "module",
4
- "version": "0.22.0",
4
+ "version": "0.22.1",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -1,9 +1,12 @@
1
- import fetch from 'cross-fetch';
1
+ export default async server => {
2
+ const fetch = (await import('cross-fetch')).default;
2
3
 
3
- export default server => async ({ path, method, expectedCode, headers, body }) => {
4
- const port = server.address().port
5
- const url = `http://localhost:${port}${path}`;
4
+ return async ({ path, method, expectedCode, headers, body }) => {
6
5
 
7
- const response = await fetch(url, { method, headers, body });
8
- expect(response.status).toBe(expectedCode);
9
- }
6
+ const port = server.address().port
7
+ const url = `http://localhost:${port}${path}`;
8
+
9
+ const response = await fetch(url, { method, headers, body });
10
+ expect(response.status).toBe(expectedCode);
11
+ };
12
+ };