@tryghost/express-test 2.3.21 → 2.3.22

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.
@@ -123,14 +123,18 @@ class ExpectRequest extends Request {
123
123
  return callback(error);
124
124
  }
125
125
 
126
- try {
127
- if (this.assertions && this.assertions.length) {
128
- this._assertAll(response);
129
- }
130
- return callback(null, response);
131
- } catch (_error) {
132
- return callback(_error);
133
- }
126
+ // Snapshot files load asynchronously; wait for the current test's
127
+ // file before running the (synchronous) assertions.
128
+ Promise.resolve(this.snapshotManager.ready && this.snapshotManager.ready())
129
+ .then(() => {
130
+ if (this.assertions && this.assertions.length) {
131
+ this._assertAll(response);
132
+ }
133
+ })
134
+ .then(
135
+ () => callback(null, response),
136
+ (_error) => callback(_error),
137
+ );
134
138
  });
135
139
  }
136
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/express-test",
3
- "version": "2.3.21",
3
+ "version": "2.3.22",
4
4
  "license": "MIT",
5
5
  "author": "Ghost Foundation",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@tryghost/jest-snapshot": "^2.3.21",
20
+ "@tryghost/jest-snapshot": "^2.3.22",
21
21
  "cookiejar": "^2.1.4",
22
22
  "form-data": "^4.0.6",
23
23
  "mime-types": "^3.0.2"
@@ -31,6 +31,9 @@
31
31
  "peerDependencies": {
32
32
  "express": "^4.0.0 || ^5.0.0"
33
33
  },
34
+ "engines": {
35
+ "node": "^22.12.0 || >=24.0.0"
36
+ },
34
37
  "scripts": {
35
38
  "dev": "echo \"Implement me!\"",
36
39
  "test": "NODE_ENV=testing vitest run --coverage",