@event-driven-io/emmett-expressjs 0.43.0-beta.10 → 0.43.0-beta.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/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1086,10 +1086,16 @@ var sendProblem = (response, statusCode, options) => {
|
|
|
1086
1086
|
// src/testing/apiE2ESpecification.ts
|
|
1087
1087
|
var _supertest = require('supertest'); var _supertest2 = _interopRequireDefault(_supertest);
|
|
1088
1088
|
var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
|
|
1089
|
-
function apiE2ESpecificationFor(optionsOrGetApplication) {
|
|
1089
|
+
function apiE2ESpecificationFor(optionsOrGetApplication, getApplication2) {
|
|
1090
1090
|
const resolveApplication = () => {
|
|
1091
|
-
if (typeof optionsOrGetApplication === "function") {
|
|
1092
|
-
|
|
1091
|
+
if (typeof optionsOrGetApplication === "function" && getApplication2) {
|
|
1092
|
+
const eventStore2 = optionsOrGetApplication();
|
|
1093
|
+
return getApplication2(eventStore2);
|
|
1094
|
+
}
|
|
1095
|
+
if (typeof optionsOrGetApplication !== "object") {
|
|
1096
|
+
throw new EmmettError(
|
|
1097
|
+
"Invalid arguments provided to apiE2ESpecificationFor. Expected either an options object or a getEventStore function and getApplication function."
|
|
1098
|
+
);
|
|
1093
1099
|
}
|
|
1094
1100
|
const eventStore = _nullishCoalesce(_optionalChain([optionsOrGetApplication, 'access', _49 => _49.getEventStore, 'optionalCall', _50 => _50()]), () => ( getInMemoryEventStore()));
|
|
1095
1101
|
return optionsOrGetApplication.getApplication(eventStore);
|