@modern-js/plugin-testing 0.0.0-nightly-20230920160608 → 0.0.0-nightly-20230922160540

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.
Files changed (86) hide show
  1. package/dist/cjs/base/config/index.js +41 -22
  2. package/dist/cjs/base/config/patches/assetsModule.js +34 -7
  3. package/dist/cjs/base/config/patches/filemock.js +21 -8
  4. package/dist/cjs/base/config/patches/index.js +28 -11
  5. package/dist/cjs/base/config/patches/transformer.js +36 -9
  6. package/dist/cjs/base/config/resolver.js +24 -6
  7. package/dist/cjs/base/config/testConfigOperator.js +32 -15
  8. package/dist/cjs/base/config/transformer/babelTransformer.js +33 -11
  9. package/dist/cjs/base/hook.js +32 -23
  10. package/dist/cjs/base/index.js +41 -34
  11. package/dist/cjs/base/runJest.js +48 -29
  12. package/dist/cjs/base/types/index.js +15 -3
  13. package/dist/cjs/base/utils.js +46 -28
  14. package/dist/cjs/cli/bff/app.js +33 -25
  15. package/dist/cjs/cli/bff/constant.js +24 -7
  16. package/dist/cjs/cli/bff/index.js +46 -27
  17. package/dist/cjs/cli/bff/mockAPI.js +40 -18
  18. package/dist/cjs/cli/bff/setup.js +33 -15
  19. package/dist/cjs/cli/bff/utils/index.js +38 -12
  20. package/dist/cjs/cli/index.js +56 -40
  21. package/dist/cjs/cli/test.js +37 -15
  22. package/dist/cjs/constant.js +24 -7
  23. package/dist/cjs/index.js +22 -6
  24. package/dist/cjs/runtime-testing/app.js +38 -17
  25. package/dist/cjs/runtime-testing/base.js +38 -11
  26. package/dist/cjs/runtime-testing/bff.js +38 -12
  27. package/dist/cjs/runtime-testing/customRender.js +36 -14
  28. package/dist/cjs/runtime-testing/index.js +22 -5
  29. package/dist/cjs/runtime-testing/reduck.js +49 -32
  30. package/dist/cjs/runtime-testing/resolvePlugins.js +21 -8
  31. package/dist/esm/base/config/index.js +6 -2
  32. package/dist/esm/base/config/patches/assetsModule.js +4 -1
  33. package/dist/esm/base/config/patches/filemock.js +4 -1
  34. package/dist/esm/base/config/patches/index.js +4 -1
  35. package/dist/esm/base/config/patches/transformer.js +4 -1
  36. package/dist/esm/base/config/resolver.js +31 -22
  37. package/dist/esm/base/config/testConfigOperator.js +3 -1
  38. package/dist/esm/base/config/transformer/babelTransformer.js +4 -1
  39. package/dist/esm/base/hook.js +8 -3
  40. package/dist/esm/base/index.js +13 -5
  41. package/dist/esm/base/runJest.js +6 -2
  42. package/dist/esm/base/types/index.js +0 -1
  43. package/dist/esm/base/utils.js +8 -3
  44. package/dist/esm/cli/bff/app.js +10 -5
  45. package/dist/esm/cli/bff/constant.js +4 -1
  46. package/dist/esm/cli/bff/index.js +15 -11
  47. package/dist/esm/cli/bff/mockAPI.js +4 -1
  48. package/dist/esm/cli/bff/setup.js +2 -2
  49. package/dist/esm/cli/bff/utils/index.js +4 -1
  50. package/dist/esm/cli/index.js +10 -4
  51. package/dist/esm/cli/test.js +4 -1
  52. package/dist/esm/constant.js +4 -1
  53. package/dist/esm/runtime-testing/app.js +4 -1
  54. package/dist/esm/runtime-testing/base.js +4 -1
  55. package/dist/esm/runtime-testing/bff.js +3 -1
  56. package/dist/esm/runtime-testing/customRender.js +4 -1
  57. package/dist/esm/runtime-testing/reduck.js +10 -4
  58. package/dist/esm/runtime-testing/resolvePlugins.js +4 -1
  59. package/dist/esm-node/base/config/index.js +6 -2
  60. package/dist/esm-node/base/config/patches/assetsModule.js +4 -1
  61. package/dist/esm-node/base/config/patches/filemock.js +4 -1
  62. package/dist/esm-node/base/config/patches/index.js +4 -1
  63. package/dist/esm-node/base/config/patches/transformer.js +4 -1
  64. package/dist/esm-node/base/config/resolver.js +29 -20
  65. package/dist/esm-node/base/config/testConfigOperator.js +3 -1
  66. package/dist/esm-node/base/config/transformer/babelTransformer.js +4 -1
  67. package/dist/esm-node/base/hook.js +8 -3
  68. package/dist/esm-node/base/index.js +13 -5
  69. package/dist/esm-node/base/runJest.js +6 -2
  70. package/dist/esm-node/base/types/index.js +0 -1
  71. package/dist/esm-node/base/utils.js +8 -3
  72. package/dist/esm-node/cli/bff/app.js +7 -2
  73. package/dist/esm-node/cli/bff/constant.js +4 -1
  74. package/dist/esm-node/cli/bff/index.js +6 -2
  75. package/dist/esm-node/cli/bff/mockAPI.js +4 -1
  76. package/dist/esm-node/cli/bff/utils/index.js +4 -1
  77. package/dist/esm-node/cli/index.js +10 -4
  78. package/dist/esm-node/cli/test.js +4 -1
  79. package/dist/esm-node/constant.js +4 -1
  80. package/dist/esm-node/runtime-testing/app.js +4 -1
  81. package/dist/esm-node/runtime-testing/base.js +4 -1
  82. package/dist/esm-node/runtime-testing/bff.js +3 -1
  83. package/dist/esm-node/runtime-testing/customRender.js +4 -1
  84. package/dist/esm-node/runtime-testing/reduck.js +10 -4
  85. package/dist/esm-node/runtime-testing/resolvePlugins.js +5 -2
  86. package/package.json +13 -13
@@ -1,41 +1,51 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
6
9
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- effects: function() {
14
- return effects;
15
- },
16
- immer: function() {
17
- return immer;
18
- },
19
- autoActions: function() {
20
- return autoActions;
21
- },
22
- createStore: function() {
23
- return createStore;
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
17
  }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var reduck_exports = {};
30
+ __export(reduck_exports, {
31
+ autoActions: () => autoActions,
32
+ createStore: () => createStore,
33
+ effects: () => effects,
34
+ immer: () => immer
25
35
  });
26
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
27
- const _store = require("@modern-js-reduck/store");
28
- const _plugineffects = /* @__PURE__ */ _interop_require_default._(require("@modern-js-reduck/plugin-effects"));
29
- const _pluginautoactions = /* @__PURE__ */ _interop_require_default._(require("@modern-js-reduck/plugin-auto-actions"));
30
- const _pluginimmutable = /* @__PURE__ */ _interop_require_default._(require("@modern-js-reduck/plugin-immutable"));
31
- const _constant = require("../constant");
32
- const effects = () => _plugineffects.default;
33
- const immer = () => _pluginimmutable.default;
34
- const autoActions = () => _pluginautoactions.default;
36
+ module.exports = __toCommonJS(reduck_exports);
37
+ var import_store = require("@modern-js-reduck/store");
38
+ var import_plugin_effects = __toESM(require("@modern-js-reduck/plugin-effects"));
39
+ var import_plugin_auto_actions = __toESM(require("@modern-js-reduck/plugin-auto-actions"));
40
+ var import_plugin_immutable = __toESM(require("@modern-js-reduck/plugin-immutable"));
41
+ var import_constant = require("../constant");
42
+ const effects = () => import_plugin_effects.default;
43
+ const immer = () => import_plugin_immutable.default;
44
+ const autoActions = () => import_plugin_auto_actions.default;
35
45
  const createStore = (props) => {
36
46
  const createStatePlugins = () => {
37
47
  var _modernConfig_runtime;
38
- const modernConfig = global[_constant.MODERNJS_CONFIG_KEY];
48
+ const modernConfig = global[import_constant.MODERNJS_CONFIG_KEY];
39
49
  const stateConfig = modernConfig === null || modernConfig === void 0 ? void 0 : (_modernConfig_runtime = modernConfig.runtime) === null || _modernConfig_runtime === void 0 ? void 0 : _modernConfig_runtime.state;
40
50
  const plugins = [];
41
51
  if ((stateConfig === null || stateConfig === void 0 ? void 0 : stateConfig.effects) !== false) {
@@ -53,5 +63,12 @@ const createStore = (props) => {
53
63
  ...props || {},
54
64
  plugins: createStatePlugins()
55
65
  };
56
- return (0, _store.createStore)(config);
66
+ return (0, import_store.createStore)(config);
57
67
  };
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ autoActions,
71
+ createStore,
72
+ effects,
73
+ immer
74
+ });
@@ -1,13 +1,26 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return resolvePlugins;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var resolvePlugins_exports = {};
20
+ __export(resolvePlugins_exports, {
21
+ default: () => resolvePlugins
10
22
  });
23
+ module.exports = __toCommonJS(resolvePlugins_exports);
11
24
  const allowedFeatures = [
12
25
  "router",
13
26
  "state"
@@ -19,7 +32,7 @@ function resolvePlugins(features) {
19
32
  }
20
33
  Object.keys(features).forEach((feature) => {
21
34
  if (allowedFeatures.includes(feature)) {
22
- const curPluginRes = require(`@modern-js/runtime/plugins`)[feature]({
35
+ const curPluginRes = require("@modern-js/runtime/plugins")[feature]({
23
36
  ...features[feature]
24
37
  });
25
38
  plugins.push(curPluginRes);
@@ -28,5 +28,9 @@ var patchConfig = function() {
28
28
  return _ref.apply(this, arguments);
29
29
  };
30
30
  }();
31
- export var DEFAULT_RESOLVER_PATH = require.resolve("./resolver");
32
- export { getJestUtils, patchConfig };
31
+ var DEFAULT_RESOLVER_PATH = require.resolve("./resolver");
32
+ export {
33
+ DEFAULT_RESOLVER_PATH,
34
+ getJestUtils,
35
+ patchConfig
36
+ };
@@ -1,4 +1,4 @@
1
- export var patchAssetsModule = function(testOperator) {
1
+ var patchAssetsModule = function(testOperator) {
2
2
  testOperator.mergeJestConfig({
3
3
  moduleNameMapper: {
4
4
  "\\.(css|less|scss|sass)$": require.resolve("identity-obj-proxy"),
@@ -6,3 +6,6 @@ export var patchAssetsModule = function(testOperator) {
6
6
  }
7
7
  });
8
8
  };
9
+ export {
10
+ patchAssetsModule
11
+ };
@@ -1 +1,4 @@
1
- export default "test-file-stub";
1
+ var filemock_default = "test-file-stub";
2
+ export {
3
+ filemock_default as default
4
+ };
@@ -80,7 +80,7 @@ var patches = [
80
80
  patchTransformer,
81
81
  patchAssetsModule
82
82
  ];
83
- export var applyPatches = function() {
83
+ var applyPatches = function() {
84
84
  var _ref = _async_to_generator(function(testConfig) {
85
85
  return _ts_generator(this, function(_state) {
86
86
  switch (_state.label) {
@@ -101,3 +101,6 @@ export var applyPatches = function() {
101
101
  return _ref.apply(this, arguments);
102
102
  };
103
103
  }();
104
+ export {
105
+ applyPatches
106
+ };
@@ -8,7 +8,7 @@ var resolveTsCompilerOptions = function() {
8
8
  tsCompilerOptions.jsx = "react-jsx";
9
9
  return tsCompilerOptions;
10
10
  };
11
- export var patchTransformer = function(testOperator) {
11
+ var patchTransformer = function(testOperator) {
12
12
  var transformer = testOperator.testConfig.transformer;
13
13
  if (transformer === "babel-jest") {
14
14
  testOperator.mergeJestConfig({
@@ -29,3 +29,6 @@ export var patchTransformer = function(testOperator) {
29
29
  });
30
30
  }
31
31
  };
32
+ export {
33
+ patchTransformer
34
+ };
@@ -1,24 +1,33 @@
1
- import enhanceResolve from "enhanced-resolve";
2
- var resolver = enhanceResolve.create.sync({
3
- conditionNames: [
4
- "require",
5
- "node",
6
- "default"
7
- ],
8
- extensions: [
9
- ".js",
10
- ".json",
11
- ".node",
12
- ".ts",
13
- ".tsx"
14
- ]
15
- });
16
- var shouldResolveByEnhance = function(url) {
17
- return /^@[^/]+\/[^/]+\/.*/.test(url);
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __commonJS = (cb, mod) => function __require() {
3
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
4
  };
19
- module.exports = function(request, options) {
20
- if (shouldResolveByEnhance(request)) {
21
- return resolver(options.basedir, request);
5
+ import enhanceResolve from "enhanced-resolve";
6
+ var require_resolver = __commonJS({
7
+ "src/base/config/resolver.ts"(exports, module) {
8
+ var resolver = enhanceResolve.create.sync({
9
+ conditionNames: [
10
+ "require",
11
+ "node",
12
+ "default"
13
+ ],
14
+ extensions: [
15
+ ".js",
16
+ ".json",
17
+ ".node",
18
+ ".ts",
19
+ ".tsx"
20
+ ]
21
+ });
22
+ var shouldResolveByEnhance = function(url) {
23
+ return /^@[^/]+\/[^/]+\/.*/.test(url);
24
+ };
25
+ module.exports = function(request, options) {
26
+ if (shouldResolveByEnhance(request)) {
27
+ return resolver(options.basedir, request);
28
+ }
29
+ return options.defaultResolver(request, options);
30
+ };
22
31
  }
23
- return options.defaultResolver(request, options);
24
- };
32
+ });
33
+ export default require_resolver();
@@ -81,4 +81,6 @@ var TestConfigOperator = /* @__PURE__ */ function() {
81
81
  ]);
82
82
  return TestConfigOperator2;
83
83
  }();
84
- export { TestConfigOperator };
84
+ export {
85
+ TestConfigOperator
86
+ };
@@ -13,4 +13,7 @@ var babelTransformer = (_babelJest_createTransformer = babelJest.createTransform
13
13
  configFile: false,
14
14
  babelrc: false
15
15
  });
16
- export default babelTransformer;
16
+ var babelTransformer_default = babelTransformer;
17
+ export {
18
+ babelTransformer_default as default
19
+ };
@@ -1,7 +1,12 @@
1
1
  import { createAsyncPipeline, createParallelWorkflow } from "@modern-js/plugin";
2
- export var jestConfigHook = createAsyncPipeline();
3
- export var afterTestHook = createParallelWorkflow();
4
- export var testingHooks = {
2
+ var jestConfigHook = createAsyncPipeline();
3
+ var afterTestHook = createParallelWorkflow();
4
+ var testingHooks = {
5
5
  jestConfig: createAsyncPipeline(),
6
6
  afterTest: createParallelWorkflow()
7
7
  };
8
+ export {
9
+ afterTestHook,
10
+ jestConfigHook,
11
+ testingHooks
12
+ };
@@ -1,6 +1,14 @@
1
- export { runTest, runJest } from "./runJest";
2
- export { getModuleNameMapper } from "./utils";
3
- export { DEFAULT_RESOLVER_PATH } from "./config";
4
- export { TestConfigOperator } from "./config/testConfigOperator";
5
- export { testingHooks } from "./hook";
1
+ import { runTest, runJest } from "./runJest";
2
+ import { getModuleNameMapper } from "./utils";
3
+ import { DEFAULT_RESOLVER_PATH } from "./config";
4
+ import { TestConfigOperator } from "./config/testConfigOperator";
5
+ import { testingHooks } from "./hook";
6
6
  export * from "./types";
7
+ export {
8
+ DEFAULT_RESOLVER_PATH,
9
+ TestConfigOperator,
10
+ getModuleNameMapper,
11
+ runJest,
12
+ runTest,
13
+ testingHooks
14
+ };
@@ -59,7 +59,7 @@ var readResultsAndExit = function(result, globalConfig) {
59
59
  }, 1e3).unref();
60
60
  }
61
61
  };
62
- export function runJest(config) {
62
+ function runJest(config) {
63
63
  return _runJest.apply(this, arguments);
64
64
  }
65
65
  function _runJest() {
@@ -114,7 +114,7 @@ function _runJest() {
114
114
  });
115
115
  return _runJest.apply(this, arguments);
116
116
  }
117
- export function runTest(api, config) {
117
+ function runTest(api, config) {
118
118
  return _runTest.apply(this, arguments);
119
119
  }
120
120
  function _runTest() {
@@ -167,3 +167,7 @@ function _runTest() {
167
167
  });
168
168
  return _runTest.apply(this, arguments);
169
169
  }
170
+ export {
171
+ runJest,
172
+ runTest
173
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -2,8 +2,8 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  import { createDebugger } from "@modern-js/utils";
5
- export var debug = createDebugger("test");
6
- export var readCompilerOptions = function() {
5
+ var debug = createDebugger("test");
6
+ var readCompilerOptions = function() {
7
7
  var pwd = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : process.cwd(), filename = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "tsconfig.json";
8
8
  var tsConfig = {};
9
9
  var extendedCompilerOptions = {};
@@ -25,7 +25,7 @@ export var readCompilerOptions = function() {
25
25
  }
26
26
  return _object_spread({}, extendedCompilerOptions, tsConfig.compilerOptions);
27
27
  };
28
- export var getModuleNameMapper = function(alias) {
28
+ var getModuleNameMapper = function(alias) {
29
29
  return Object.keys(alias).reduce(function(memo, cur) {
30
30
  var aliasValue = Array.isArray(alias[cur]) ? alias[cur] : [
31
31
  alias[cur]
@@ -46,3 +46,8 @@ export var getModuleNameMapper = function(alias) {
46
46
  return memo;
47
47
  }, {});
48
48
  };
49
+ export {
50
+ debug,
51
+ getModuleNameMapper,
52
+ readCompilerOptions
53
+ };
@@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import { AsyncLocalStorage } from "async_hooks";
4
4
  import { Server } from "@modern-js/prod-server";
5
5
  var store = new AsyncLocalStorage();
6
- export var isInHandler = function() {
6
+ var isInHandler = function() {
7
7
  return Boolean(store.getStore());
8
8
  };
9
9
  var server = null;
@@ -21,10 +21,10 @@ var createApp = function() {
21
21
  config.output.path = "./";
22
22
  server = new Server({
23
23
  apiOnly: true,
24
- pwd: pwd,
25
- config: config,
24
+ pwd,
25
+ config,
26
26
  internalPlugins: plugins,
27
- routes: routes
27
+ routes
28
28
  });
29
29
  return [
30
30
  4,
@@ -76,4 +76,9 @@ var closeServer = function() {
76
76
  return _ref.apply(this, arguments);
77
77
  };
78
78
  }();
79
- export { createApp, getApp, closeServer };
79
+ export {
80
+ closeServer,
81
+ createApp,
82
+ getApp,
83
+ isInHandler
84
+ };
@@ -1 +1,4 @@
1
- export var bff_info_key = "modern_bff_info";
1
+ var bff_info_key = "modern_bff_info";
2
+ export {
3
+ bff_info_key
4
+ };
@@ -7,7 +7,7 @@ import { isApiOnly } from "@modern-js/utils";
7
7
  import { getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../../base";
8
8
  import { bff_info_key } from "./constant";
9
9
  import { isBFFProject } from "./utils";
10
- export var setJestConfigForBFF = function() {
10
+ var setJestConfigForBFF = function() {
11
11
  var _ref = _async_to_generator(function(param) {
12
12
  var pwd, userConfig, plugins, routes, utils, _userConfig_source, bffConfig, jestConfig, alias, aliasMapper, moduleNameMapper, transform, apiOnly, mergedModuleNameMapper, resolver, configFields, commonConfig;
13
13
  return _ts_generator(this, function(_state) {
@@ -29,8 +29,8 @@ export var setJestConfigForBFF = function() {
29
29
  globals: _define_property({}, bff_info_key, {
30
30
  appDir: pwd,
31
31
  modernUserConfig: userConfig,
32
- plugins: plugins,
33
- routes: routes
32
+ plugins,
33
+ routes
34
34
  })
35
35
  };
36
36
  jestConfig = utils.jestConfig;
@@ -71,9 +71,9 @@ export var setJestConfigForBFF = function() {
71
71
  projects: [
72
72
  _object_spread({}, jestConfig),
73
73
  _object_spread({
74
- transform: transform,
74
+ transform,
75
75
  moduleNameMapper: mergedModuleNameMapper,
76
- resolver: resolver
76
+ resolver
77
77
  }, bffConfig)
78
78
  ]
79
79
  }, {
@@ -83,9 +83,9 @@ export var setJestConfigForBFF = function() {
83
83
  utils.setJestConfig({
84
84
  projects: [
85
85
  _object_spread({
86
- transform: transform,
86
+ transform,
87
87
  moduleNameMapper: mergedModuleNameMapper,
88
- resolver: resolver
88
+ resolver
89
89
  }, bffConfig)
90
90
  ]
91
91
  }, {
@@ -103,7 +103,7 @@ export var setJestConfigForBFF = function() {
103
103
  return _ref.apply(this, arguments);
104
104
  };
105
105
  }();
106
- export var testingBffPlugin = function() {
106
+ var testingBffPlugin = function() {
107
107
  return {
108
108
  name: "@modern-js/testing-plugin-bff",
109
109
  setup: function setup(api) {
@@ -126,11 +126,11 @@ export var testingBffPlugin = function() {
126
126
  return [
127
127
  4,
128
128
  setJestConfigForBFF({
129
- pwd: pwd,
130
- userConfig: userConfig,
129
+ pwd,
130
+ userConfig,
131
131
  routes: appContext.serverRoutes,
132
132
  plugins: appContext.serverInternalPlugins,
133
- utils: utils
133
+ utils
134
134
  })
135
135
  ];
136
136
  case 1:
@@ -150,3 +150,7 @@ export var testingBffPlugin = function() {
150
150
  }
151
151
  };
152
152
  };
153
+ export {
154
+ setJestConfigForBFF,
155
+ testingBffPlugin
156
+ };
@@ -46,7 +46,7 @@ var mock_getParamsAndPayload = function(args) {
46
46
  }
47
47
  }
48
48
  };
49
- export default function(mockApiInfosByFile) {
49
+ function mockAPI_default(mockApiInfosByFile) {
50
50
  var files = Object.keys(mockApiInfosByFile);
51
51
  files.forEach(function(mockedFile) {
52
52
  jest.mock(mockedFile, function() {
@@ -104,3 +104,6 @@ export default function(mockApiInfosByFile) {
104
104
  });
105
105
  }
106
106
  ;
107
+ export {
108
+ mockAPI_default as default
109
+ };
@@ -24,8 +24,8 @@ var setup = function() {
24
24
  apiRouter = new ApiRouter({
25
25
  appDir: bff_info.appDir,
26
26
  apiDir: path.join(bff_info.appDir, "./api"),
27
- prefix: prefix,
28
- httpMethodDecider: httpMethodDecider
27
+ prefix,
28
+ httpMethodDecider
29
29
  });
30
30
  apiInfos = apiRouter.getApiHandlers();
31
31
  apiInfosByFile = apiInfos.reduce(function(res, apiInfo) {
@@ -1,7 +1,7 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import path from "path";
3
3
  import { chalk } from "@modern-js/utils";
4
- export var isBFFProject = function(pwd) {
4
+ var isBFFProject = function(pwd) {
5
5
  try {
6
6
  var packageJson = require(path.join(pwd, "./package.json"));
7
7
  var dependencies = packageJson.dependencies, devDependencies = packageJson.devDependencies;
@@ -17,3 +17,6 @@ export var isBFFProject = function(pwd) {
17
17
  return false;
18
18
  }
19
19
  };
20
+ export {
21
+ isBFFProject
22
+ };
@@ -7,13 +7,13 @@ import { testingHooks, getModuleNameMapper, DEFAULT_RESOLVER_PATH } from "../bas
7
7
  import { MODERNJS_CONFIG_KEY } from "../constant";
8
8
  import { testingBffPlugin } from "./bff";
9
9
  import test from "./test";
10
- export var mergeUserJestConfig = function(testUtils) {
10
+ var mergeUserJestConfig = function(testUtils) {
11
11
  var resolveJestConfig = testUtils.testConfig.jest;
12
12
  if (resolveJestConfig && typeof resolveJestConfig !== "function") {
13
13
  testUtils.mergeJestConfig(resolveJestConfig);
14
14
  }
15
15
  };
16
- export var getJestTransformEsModulesRegStr = function() {
16
+ var getJestTransformEsModulesRegStr = function() {
17
17
  var esmModulesInPnpm = [
18
18
  "@modern-js\\+runtime@",
19
19
  "@modern-js\\+plugin@",
@@ -29,7 +29,7 @@ export var getJestTransformEsModulesRegStr = function() {
29
29
  ];
30
30
  return "node_modules/(?!(\\.pnpm/(".concat(esmModulesInPnpm.join("|"), "))|(").concat(esmModules.join("|"), "))");
31
31
  };
32
- export var testingPlugin = function() {
32
+ var testingPlugin = function() {
33
33
  var bffPlugin = testingBffPlugin();
34
34
  return {
35
35
  name: "@modern-js/plugin-testing",
@@ -173,4 +173,10 @@ export var testingPlugin = function() {
173
173
  }
174
174
  };
175
175
  };
176
- export default testingPlugin;
176
+ var cli_default = testingPlugin;
177
+ export {
178
+ cli_default as default,
179
+ getJestTransformEsModulesRegStr,
180
+ mergeUserJestConfig,
181
+ testingPlugin
182
+ };
@@ -54,4 +54,7 @@ var test = function() {
54
54
  return _ref.apply(this, arguments);
55
55
  };
56
56
  }();
57
- export default test;
57
+ var test_default = test;
58
+ export {
59
+ test_default as default
60
+ };
@@ -1 +1,4 @@
1
- export var MODERNJS_CONFIG_KEY = "__modernjs_config__";
1
+ var MODERNJS_CONFIG_KEY = "__modernjs_config__";
2
+ export {
3
+ MODERNJS_CONFIG_KEY
4
+ };
@@ -43,4 +43,7 @@ var ModernRuntime = /* @__PURE__ */ function() {
43
43
  ]);
44
44
  return ModernRuntime2;
45
45
  }();
46
- export default new ModernRuntime(global[MODERNJS_CONFIG_KEY] || {});
46
+ var app_default = new ModernRuntime(global[MODERNJS_CONFIG_KEY] || {});
47
+ export {
48
+ app_default as default
49
+ };
@@ -1,2 +1,5 @@
1
- export { default as renderApp } from "./customRender";
1
+ import { default as default2 } from "./customRender";
2
2
  export * from "@testing-library/react";
3
+ export {
4
+ default2 as renderApp
5
+ };
@@ -16,4 +16,6 @@ function request() {
16
16
  fn.returnHttp = false;
17
17
  return res;
18
18
  }
19
- export { request as testBff };
19
+ export {
20
+ request as testBff
21
+ };
@@ -10,4 +10,7 @@ var customRender = function(ui, options) {
10
10
  wrapper: WrapModernProviders
11
11
  }, options));
12
12
  };
13
- export default customRender;
13
+ var customRender_default = customRender;
14
+ export {
15
+ customRender_default as default
16
+ };
@@ -5,16 +5,16 @@ import effectsPlugin from "@modern-js-reduck/plugin-effects";
5
5
  import autoActionsPlugin from "@modern-js-reduck/plugin-auto-actions";
6
6
  import immerPlugin from "@modern-js-reduck/plugin-immutable";
7
7
  import { MODERNJS_CONFIG_KEY } from "../constant";
8
- export var effects = function() {
8
+ var effects = function() {
9
9
  return effectsPlugin;
10
10
  };
11
- export var immer = function() {
11
+ var immer = function() {
12
12
  return immerPlugin;
13
13
  };
14
- export var autoActions = function() {
14
+ var autoActions = function() {
15
15
  return autoActionsPlugin;
16
16
  };
17
- export var createStore = function(props) {
17
+ var createStore = function(props) {
18
18
  var createStatePlugins = function() {
19
19
  var _modernConfig_runtime;
20
20
  var modernConfig = global[MODERNJS_CONFIG_KEY];
@@ -36,3 +36,9 @@ export var createStore = function(props) {
36
36
  });
37
37
  return originCreateStore(config);
38
38
  };
39
+ export {
40
+ autoActions,
41
+ createStore,
42
+ effects,
43
+ immer
44
+ };