@wdio/config 5.9.3 → 5.11.0

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.
@@ -7,8 +7,6 @@ exports.SUPPORTED_HOOKS = exports.DEFAULT_CONFIGS = void 0;
7
7
  const DEFAULT_TIMEOUT = 10000;
8
8
  /* istanbul ignore next */
9
9
 
10
- const NOOP = function () {};
11
-
12
10
  const DEFAULT_CONFIGS = {
13
11
  sync: true,
14
12
  specs: [],
@@ -50,7 +48,7 @@ const DEFAULT_CONFIGS = {
50
48
  /**
51
49
  * hooks
52
50
  */
53
- onPrepare: NOOP,
51
+ onPrepare: [],
54
52
  before: [],
55
53
  beforeSession: [],
56
54
  beforeSuite: [],
@@ -63,7 +61,7 @@ const DEFAULT_CONFIGS = {
63
61
  afterSuite: [],
64
62
  afterSession: [],
65
63
  after: [],
66
- onComplete: NOOP,
64
+ onComplete: [],
67
65
  onReload: [],
68
66
 
69
67
  /**
@@ -77,7 +75,5 @@ const DEFAULT_CONFIGS = {
77
75
  afterStep: []
78
76
  };
79
77
  exports.DEFAULT_CONFIGS = DEFAULT_CONFIGS;
80
- const SUPPORTED_HOOKS = ['before', 'beforeSession', 'beforeSuite', 'beforeHook', 'beforeTest', 'beforeCommand', 'afterCommand', 'afterTest', 'afterHook', 'afterSuite', 'afterSession', 'after', 'beforeFeature', 'beforeScenario', 'beforeStep', 'afterFeature', 'afterScenario', 'afterStep', 'onReload' // the following hooks are excluded since they are part of the launcher
81
- // 'onPrepare', 'onComplete'
82
- ];
78
+ const SUPPORTED_HOOKS = ['before', 'beforeSession', 'beforeSuite', 'beforeHook', 'beforeTest', 'beforeCommand', 'afterCommand', 'afterTest', 'afterHook', 'afterSuite', 'afterSession', 'after', 'beforeFeature', 'beforeScenario', 'beforeStep', 'afterFeature', 'afterScenario', 'afterStep', 'onReload', 'onPrepare', 'onComplete'];
83
79
  exports.SUPPORTED_HOOKS = SUPPORTED_HOOKS;
package/build/index.js CHANGED
@@ -57,6 +57,18 @@ Object.defineProperty(exports, "hasWdioSyncSupport", {
57
57
  return _shim.hasWdioSyncSupport;
58
58
  }
59
59
  });
60
+ Object.defineProperty(exports, "executeSync", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _shim.executeSync;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "executeAsync", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _shim.executeAsync;
70
+ }
71
+ });
60
72
  Object.defineProperty(exports, "DEFAULT_CONFIGS", {
61
73
  enumerable: true,
62
74
  get: function () {
@@ -57,7 +57,8 @@ class ConfigParser {
57
57
  this._capabilities = (0, _deepmerge.default)(this._capabilities, fileConfig.capabilities || defaultTo, MERGE_OPTIONS);
58
58
  delete fileConfig.capabilities;
59
59
  /**
60
- * add service hooks and remove them from config
60
+ * Add hooks from the file config and remove them from file config object to avoid
61
+ * complications when using merge function
61
62
  */
62
63
 
63
64
  this.addService(fileConfig);
@@ -141,8 +142,8 @@ class ConfigParser {
141
142
  this._config = (0, _deepmerge.default)((0, _utils.detectBackend)(this._config), this._config, MERGE_OPTIONS);
142
143
  }
143
144
  /**
144
- * add hooks from services to runner config
145
- * @param {Object} service a service is basically an object that contains hook methods
145
+ * Add hooks from an existing service to the runner config.
146
+ * @param {Object} service - an object that contains hook methods.
146
147
  */
147
148
 
148
149
 
package/build/shim.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.hasWdioSyncSupport = exports.wrapCommand = exports.runFnInFiberContext = exports.runTestInFiberContext = exports.executeHooksWithArgs = void 0;
6
+ exports.executeAsync = exports.executeSync = exports.hasWdioSyncSupport = exports.wrapCommand = exports.runFnInFiberContext = exports.runTestInFiberContext = exports.executeHooksWithArgs = void 0;
7
7
 
8
8
  var _logger = _interopRequireDefault(require("@wdio/logger"));
9
9
 
@@ -72,11 +72,19 @@ let wrapCommand = (_, origFn) => origFn;
72
72
 
73
73
  exports.wrapCommand = wrapCommand;
74
74
  let hasWdioSyncSupport = false;
75
+ exports.hasWdioSyncSupport = hasWdioSyncSupport;
76
+
77
+ let executeSync = (fn, _, args = []) => fn.apply(void 0, args);
78
+
79
+ exports.executeSync = executeSync;
80
+
81
+ let executeAsync = (fn, _, args = []) => fn.apply(void 0, args);
75
82
  /**
76
83
  * shim to make sure that we only wrap commands if wdio-sync is installed as dependency
77
84
  */
78
85
 
79
- exports.hasWdioSyncSupport = hasWdioSyncSupport;
86
+
87
+ exports.executeAsync = executeAsync;
80
88
 
81
89
  try {
82
90
  // eslint-disable-next-line import/no-unresolved
@@ -87,5 +95,7 @@ try {
87
95
  exports.runTestInFiberContext = runTestInFiberContext = wdioSync.runTestInFiberContext;
88
96
  exports.wrapCommand = wrapCommand = wdioSync.wrapCommand;
89
97
  exports.executeHooksWithArgs = executeHooksWithArgs = wdioSync.executeHooksWithArgs;
98
+ exports.executeSync = executeSync = wdioSync.executeSync;
99
+ exports.executeAsync = executeAsync = wdioSync.executeAsync;
90
100
  } catch (_unused) {// do nothing
91
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/config",
3
- "version": "5.9.3",
3
+ "version": "5.11.0",
4
4
  "description": "A helper utility to parse and validate WebdriverIO options",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-config",
@@ -30,12 +30,12 @@
30
30
  "url": "https://github.com/webdriverio/webdriverio/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@wdio/logger": "^5.9.3",
34
- "deepmerge": "^3.2.0",
33
+ "@wdio/logger": "^5.11.0",
34
+ "deepmerge": "^4.0.0",
35
35
  "glob": "^7.1.2"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "94c7a26fd99230516d430161989e794492893e07"
40
+ "gitHead": "f235de6d9876a1a81bc1007430346d493ba7f579"
41
41
  }