@zohodesk/testinglibrary 0.1.4-exp.2 → 0.1.4-exp.3

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.
@@ -11,6 +11,8 @@ exports.isUserConfigFileAvailable = isUserConfigFileAvailable;
11
11
  var _fs = require("fs");
12
12
  var _path = _interopRequireDefault(require("path"));
13
13
  var _logger = require("../../utils/logger");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
16
  const fileName = 'uat.config.js';
15
17
  exports.fileName = fileName;
16
18
  function getDefaultConfig() {
@@ -95,7 +97,7 @@ function generateConfigFromFile() {
95
97
  const filePath = _path.default.resolve(process.cwd(), fileName);
96
98
  if ((0, _fs.existsSync)(filePath)) {
97
99
  /** @type {UserConfig} */
98
- const config = require(filePath);
100
+ const config = (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(filePath).then(v => v.default);
99
101
  const modifiedConfiguration = combineDefaultConfigWithUserConfig(config);
100
102
  return modifiedConfiguration;
101
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.4-exp.2",
3
+ "version": "0.1.4-exp.3",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -51,4 +51,4 @@
51
51
  "@babel/runtime": "7.22.15",
52
52
  "commander": "^11.0.0"
53
53
  }
54
- }
54
+ }