creevey 0.9.0-beta.2 → 0.9.0-non-webpack.1

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 (236) hide show
  1. package/AUTHORS +15 -15
  2. package/CHANGELOG.md +1275 -1275
  3. package/LICENSE +21 -21
  4. package/README.md +7 -0
  5. package/addon/README.md +3 -0
  6. package/addon/package.json +4 -0
  7. package/docs/config.md +212 -212
  8. package/docs/grid.md +10 -10
  9. package/docs/tests.md +63 -63
  10. package/jest.config.js +6 -0
  11. package/lib/cjs/client/addon/Manager.js +123 -271
  12. package/lib/cjs/client/addon/components/Addon.js +17 -38
  13. package/lib/cjs/client/addon/components/Icons.js +12 -8
  14. package/lib/cjs/client/addon/components/Panel.js +17 -13
  15. package/lib/cjs/client/addon/components/TestSelect.js +11 -9
  16. package/lib/cjs/client/addon/components/Tools.js +21 -40
  17. package/lib/cjs/client/addon/decorator.js +1 -1
  18. package/lib/cjs/client/addon/index.js +31 -0
  19. package/lib/cjs/client/addon/preset.js +13 -32
  20. package/lib/cjs/client/addon/register.js +46 -70
  21. package/lib/cjs/client/addon/utils.js +1 -1
  22. package/lib/cjs/client/addon/withCreevey.js +164 -344
  23. package/lib/cjs/client/shared/components/ImagesView/BlendView.js +23 -21
  24. package/lib/cjs/client/shared/components/ImagesView/ImagesView.js +22 -18
  25. package/lib/cjs/client/shared/components/ImagesView/SideBySideView.js +42 -64
  26. package/lib/cjs/client/shared/components/ImagesView/SlideView.js +35 -48
  27. package/lib/cjs/client/shared/components/ImagesView/SwapView.js +24 -43
  28. package/lib/cjs/client/shared/components/ImagesView/index.js +9 -9
  29. package/lib/cjs/client/shared/components/PageFooter/PageFooter.js +12 -8
  30. package/lib/cjs/client/shared/components/PageFooter/Paging.js +14 -18
  31. package/lib/cjs/client/shared/components/PageHeader/ImagePreview.js +22 -18
  32. package/lib/cjs/client/shared/components/PageHeader/PageHeader.js +42 -67
  33. package/lib/cjs/client/shared/components/ResultsPage.js +39 -69
  34. package/lib/cjs/client/shared/creeveyClientApi.js +55 -82
  35. package/lib/cjs/client/shared/helpers.js +143 -214
  36. package/lib/cjs/client/shared/viewMode.js +5 -5
  37. package/lib/cjs/client/web/142.js +2 -0
  38. package/lib/cjs/client/web/142.js.LICENSE.txt +12 -0
  39. package/lib/cjs/client/web/32.js +1 -0
  40. package/lib/cjs/client/web/551.js +1 -0
  41. package/lib/cjs/client/web/566.js +2 -0
  42. package/lib/cjs/client/web/566.js.LICENSE.txt +31 -0
  43. package/lib/cjs/client/web/691.js +2 -0
  44. package/lib/cjs/client/web/691.js.LICENSE.txt +8 -0
  45. package/lib/cjs/client/web/725.js +1 -0
  46. package/lib/cjs/client/web/index.html +19 -19
  47. package/lib/cjs/client/web/main.js +2 -38
  48. package/lib/cjs/client/web/main.js.LICENSE.txt +49 -0
  49. package/lib/cjs/creevey.js +3 -5
  50. package/lib/cjs/index.js +4 -4
  51. package/lib/cjs/server/config.js +1 -1
  52. package/lib/cjs/server/docker.js +3 -7
  53. package/lib/cjs/server/index.js +1 -1
  54. package/lib/cjs/server/loaders/babel/creevey-plugin.js +1 -3
  55. package/lib/cjs/server/loaders/babel/helpers.js +13 -23
  56. package/lib/cjs/server/loaders/babel/register.js +1 -3
  57. package/lib/cjs/server/loaders/webpack/compile.js +31 -24
  58. package/lib/cjs/server/loaders/webpack/creevey-loader.js +10 -5
  59. package/lib/cjs/server/loaders/webpack/dummy-hmr.js +2 -7
  60. package/lib/cjs/server/loaders/webpack/mdx-loader.js +1 -1
  61. package/lib/cjs/server/loaders/webpack/start.js +1 -1
  62. package/lib/cjs/server/logger.js +2 -1
  63. package/lib/cjs/server/master/index.js +2 -2
  64. package/lib/cjs/server/master/pool.js +9 -18
  65. package/lib/cjs/server/master/runner.js +53 -66
  66. package/lib/cjs/server/master/server.js +2 -2
  67. package/lib/cjs/server/messages.js +8 -10
  68. package/lib/cjs/server/selenium/browser.js +23 -31
  69. package/lib/cjs/server/selenium/selenoid.js +5 -7
  70. package/lib/cjs/server/stories.js +9 -20
  71. package/lib/cjs/server/storybook/entry.js +5 -3
  72. package/lib/cjs/server/storybook/helpers.js +15 -21
  73. package/lib/cjs/server/storybook/providers/browser.js +5 -9
  74. package/lib/cjs/server/storybook/providers/nodejs.js +4 -4
  75. package/lib/cjs/server/update.js +1 -5
  76. package/lib/cjs/server/utils.js +13 -15
  77. package/lib/cjs/server/worker/reporter.js +8 -20
  78. package/lib/cjs/server/worker/worker.js +6 -16
  79. package/lib/cjs/shared/index.js +101 -0
  80. package/lib/cjs/shared/serializeRegExp.js +42 -0
  81. package/lib/cjs/types.js +6 -6
  82. package/lib/esm/client/addon/Manager.js +123 -271
  83. package/lib/esm/client/addon/components/Addon.js +15 -34
  84. package/lib/esm/client/addon/components/Icons.js +11 -7
  85. package/lib/esm/client/addon/components/Panel.js +17 -13
  86. package/lib/esm/client/addon/components/TestSelect.js +11 -9
  87. package/lib/esm/client/addon/components/Tools.js +19 -36
  88. package/lib/esm/client/addon/decorator.js +1 -1
  89. package/lib/esm/client/addon/index.js +2 -0
  90. package/lib/esm/client/addon/preset.js +10 -25
  91. package/lib/esm/client/addon/register.js +42 -66
  92. package/lib/esm/client/addon/utils.js +1 -1
  93. package/lib/esm/client/addon/withCreevey.js +157 -341
  94. package/lib/esm/client/shared/components/ImagesView/BlendView.js +21 -17
  95. package/lib/esm/client/shared/components/ImagesView/ImagesView.js +21 -17
  96. package/lib/esm/client/shared/components/ImagesView/SideBySideView.js +40 -60
  97. package/lib/esm/client/shared/components/ImagesView/SlideView.js +33 -44
  98. package/lib/esm/client/shared/components/ImagesView/SwapView.js +22 -39
  99. package/lib/esm/client/shared/components/PageFooter/PageFooter.js +12 -8
  100. package/lib/esm/client/shared/components/PageFooter/Paging.js +14 -18
  101. package/lib/esm/client/shared/components/PageHeader/ImagePreview.js +22 -18
  102. package/lib/esm/client/shared/components/PageHeader/PageHeader.js +37 -60
  103. package/lib/esm/client/shared/components/ResultsPage.js +36 -64
  104. package/lib/esm/client/shared/creeveyClientApi.js +57 -84
  105. package/lib/esm/client/shared/helpers.js +127 -198
  106. package/lib/esm/client/shared/viewMode.js +4 -4
  107. package/lib/esm/creevey.js +3 -5
  108. package/lib/esm/index.js +1 -3
  109. package/lib/esm/server/docker.js +2 -2
  110. package/lib/esm/server/index.js +1 -1
  111. package/lib/esm/server/loaders/babel/creevey-plugin.js +1 -3
  112. package/lib/esm/server/loaders/babel/helpers.js +12 -22
  113. package/lib/esm/server/loaders/babel/register.js +1 -3
  114. package/lib/esm/server/loaders/webpack/compile.js +31 -24
  115. package/lib/esm/server/loaders/webpack/creevey-loader.js +9 -4
  116. package/lib/esm/server/loaders/webpack/dummy-hmr.js +2 -6
  117. package/lib/esm/server/loaders/webpack/start.js +1 -1
  118. package/lib/esm/server/master/index.js +2 -2
  119. package/lib/esm/server/master/pool.js +7 -18
  120. package/lib/esm/server/master/runner.js +53 -66
  121. package/lib/esm/server/master/server.js +2 -2
  122. package/lib/esm/server/messages.js +3 -5
  123. package/lib/esm/server/selenium/browser.js +20 -28
  124. package/lib/esm/server/selenium/selenoid.js +4 -6
  125. package/lib/esm/server/stories.js +9 -20
  126. package/lib/esm/server/storybook/entry.js +4 -2
  127. package/lib/esm/server/storybook/helpers.js +7 -15
  128. package/lib/esm/server/storybook/providers/browser.js +4 -5
  129. package/lib/esm/server/storybook/providers/nodejs.js +3 -3
  130. package/lib/esm/server/update.js +1 -5
  131. package/lib/esm/server/utils.js +5 -9
  132. package/lib/esm/server/worker/reporter.js +8 -20
  133. package/lib/esm/server/worker/worker.js +6 -16
  134. package/lib/esm/shared/index.js +78 -0
  135. package/lib/esm/shared/serializeRegExp.js +24 -0
  136. package/lib/types/cli.d.ts +1 -1
  137. package/lib/types/client/addon/Manager.d.ts +37 -37
  138. package/lib/types/client/addon/components/Addon.d.ts +8 -8
  139. package/lib/types/client/addon/components/Icons.d.ts +7 -7
  140. package/lib/types/client/addon/components/Panel.d.ts +9 -9
  141. package/lib/types/client/addon/components/TestSelect.d.ts +8 -9
  142. package/lib/types/client/addon/components/Tools.d.ts +6 -6
  143. package/lib/types/client/addon/decorator.d.ts +1 -1
  144. package/lib/types/client/addon/index.d.ts +2 -0
  145. package/lib/types/client/addon/preset.d.ts +23 -24
  146. package/lib/types/client/addon/readyForCapture.d.ts +6 -6
  147. package/lib/types/client/addon/register.d.ts +3 -3
  148. package/lib/types/client/addon/utils.d.ts +2 -2
  149. package/lib/types/client/addon/withCreevey.d.ts +24 -24
  150. package/lib/types/client/shared/components/ImagesView/BlendView.d.ts +3 -3
  151. package/lib/types/client/shared/components/ImagesView/ImagesView.d.ts +24 -25
  152. package/lib/types/client/shared/components/ImagesView/SideBySideView.d.ts +3 -3
  153. package/lib/types/client/shared/components/ImagesView/SlideView.d.ts +3 -3
  154. package/lib/types/client/shared/components/ImagesView/SwapView.d.ts +3 -3
  155. package/lib/types/client/shared/components/ImagesView/index.d.ts +5 -5
  156. package/lib/types/client/shared/components/PageFooter/PageFooter.d.ts +8 -9
  157. package/lib/types/client/shared/components/PageFooter/Paging.d.ts +7 -8
  158. package/lib/types/client/shared/components/PageHeader/ImagePreview.d.ts +12 -12
  159. package/lib/types/client/shared/components/PageHeader/PageHeader.d.ts +16 -17
  160. package/lib/types/client/shared/components/ResultsPage.d.ts +18 -18
  161. package/lib/types/client/shared/creeveyClientApi.d.ts +9 -9
  162. package/lib/types/client/shared/helpers.d.ts +46 -46
  163. package/lib/types/client/shared/viewMode.d.ts +4 -4
  164. package/lib/types/client/web/CreeveyApp.d.ts +11 -12
  165. package/lib/types/client/web/CreeveyContext.d.ts +11 -11
  166. package/lib/types/client/web/CreeveyLoader.d.ts +2 -3
  167. package/lib/types/client/web/CreeveyView/SideBar/Checkbox.d.ts +19 -19
  168. package/lib/types/client/web/CreeveyView/SideBar/Search.d.ts +6 -6
  169. package/lib/types/client/web/CreeveyView/SideBar/SideBar.d.ts +14 -14
  170. package/lib/types/client/web/CreeveyView/SideBar/SideBarHeader.d.ts +12 -13
  171. package/lib/types/client/web/CreeveyView/SideBar/SuiteLink.d.ts +33 -33
  172. package/lib/types/client/web/CreeveyView/SideBar/TestLink.d.ts +7 -8
  173. package/lib/types/client/web/CreeveyView/SideBar/TestStatusIcon.d.ts +10 -10
  174. package/lib/types/client/web/CreeveyView/SideBar/TestsStatus.d.ts +9 -9
  175. package/lib/types/client/web/CreeveyView/SideBar/Toggle.d.ts +6 -6
  176. package/lib/types/client/web/CreeveyView/SideBar/index.d.ts +1 -1
  177. package/lib/types/client/web/KeyboardEventsContext.d.ts +13 -13
  178. package/lib/types/client/web/index.d.ts +4 -4
  179. package/lib/types/creevey.d.ts +1 -1
  180. package/lib/types/index.d.ts +0 -1
  181. package/lib/types/server/config.d.ts +4 -4
  182. package/lib/types/server/docker.d.ts +7 -7
  183. package/lib/types/server/extract.d.ts +2 -2
  184. package/lib/types/server/index.d.ts +2 -2
  185. package/lib/types/server/loaders/babel/creevey-plugin.d.ts +1 -1
  186. package/lib/types/server/loaders/babel/helpers.d.ts +19 -19
  187. package/lib/types/server/loaders/babel/register.d.ts +5 -5
  188. package/lib/types/server/loaders/hooks/mdx.d.ts +1 -1
  189. package/lib/types/server/loaders/hooks/svelte.d.ts +1 -1
  190. package/lib/types/server/loaders/webpack/compile.d.ts +2 -2
  191. package/lib/types/server/loaders/webpack/creevey-loader.d.ts +4 -2
  192. package/lib/types/server/loaders/webpack/dummy-hmr.d.ts +10 -10
  193. package/lib/types/server/loaders/webpack/mdx-loader.d.ts +6 -6
  194. package/lib/types/server/loaders/webpack/start.d.ts +1 -1
  195. package/lib/types/server/logger.d.ts +10 -6
  196. package/lib/types/server/master/api.d.ts +7 -7
  197. package/lib/types/server/master/index.d.ts +3 -3
  198. package/lib/types/server/master/master.d.ts +7 -7
  199. package/lib/types/server/master/pool.d.ts +31 -31
  200. package/lib/types/server/master/runner.d.ts +26 -26
  201. package/lib/types/server/master/server.d.ts +2 -2
  202. package/lib/types/server/messages.d.ts +27 -27
  203. package/lib/types/server/selenium/browser.d.ts +17 -17
  204. package/lib/types/server/selenium/index.d.ts +2 -2
  205. package/lib/types/server/selenium/selenoid.d.ts +3 -3
  206. package/lib/types/server/stories.d.ts +8 -8
  207. package/lib/types/server/storybook/entry.d.ts +18 -18
  208. package/lib/types/server/storybook/helpers.d.ts +24 -24
  209. package/lib/types/server/storybook/providers/browser.d.ts +4 -4
  210. package/lib/types/server/storybook/providers/hybrid.d.ts +4 -4
  211. package/lib/types/server/storybook/providers/nodejs.d.ts +9 -9
  212. package/lib/types/server/testsFiles/parser.d.ts +12 -12
  213. package/lib/types/server/testsFiles/register.d.ts +2 -2
  214. package/lib/types/server/update.d.ts +2 -2
  215. package/lib/types/server/utils.d.ts +20 -20
  216. package/lib/types/server/worker/chai-image.d.ts +6 -6
  217. package/lib/types/server/worker/helpers.d.ts +8 -8
  218. package/lib/types/server/worker/index.d.ts +1 -1
  219. package/lib/types/server/worker/reporter.d.ts +8 -8
  220. package/lib/types/server/worker/worker.d.ts +4 -4
  221. package/lib/types/{shared.d.ts → shared/index.d.ts} +7 -16
  222. package/lib/types/shared/serializeRegExp.d.ts +9 -0
  223. package/lib/types/types.d.ts +490 -489
  224. package/package.json +115 -102
  225. package/preset.js +9 -9
  226. package/types/babel__register.d.ts +1 -1
  227. package/types/chai.d.ts +12 -12
  228. package/types/event-source-polyfill.d.ts +6 -6
  229. package/types/mdx.d.ts +3 -2
  230. package/types/mocha.d.ts +20 -20
  231. package/types/png.d.ts +4 -4
  232. package/lib/cjs/client/web/1.js +0 -13
  233. package/lib/cjs/client/web/2.js +0 -1
  234. package/lib/cjs/shared.js +0 -124
  235. package/lib/esm/shared.js +0 -93
  236. package/storybook-static/stories.json +0 -21
@@ -1,41 +1,13 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
4
-
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6
-
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8
-
9
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
-
11
- function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
12
-
13
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
-
15
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
-
17
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
18
-
19
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
-
21
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
-
23
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
24
-
25
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
26
-
27
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
28
-
29
1
  import { themes } from '@storybook/theming';
30
2
  import { parse, stringify } from 'qs';
31
3
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
32
4
  import { isTest, isDefined } from '../../types';
33
- var statusUpdatesMap = new Map([[undefined, /(unknown|success|failed|pending|running)/], ['unknown', /(success|failed|pending|running)/], ['success', /(failed|pending|running)/], ['failed', /(pending|running)/], ['pending', /running/]]);
5
+ const statusUpdatesMap = new Map([[undefined, /(unknown|success|failed|pending|running)/], ['unknown', /(success|failed|pending|running)/], ['success', /(failed|pending|running)/], ['failed', /(pending|running)/], ['pending', /running/]]);
34
6
 
35
7
  function makeEmptySuiteNode() {
36
- var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
8
+ let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
37
9
  return {
38
- path: path,
10
+ path,
39
11
  skip: true,
40
12
  opened: false,
41
13
  checked: true,
@@ -50,24 +22,24 @@ export function calcStatus(oldStatus, newStatus) {
50
22
  return newStatus && (_statusUpdatesMap$get = statusUpdatesMap.get(oldStatus)) !== null && _statusUpdatesMap$get !== void 0 && _statusUpdatesMap$get.test(newStatus) ? newStatus : oldStatus;
51
23
  }
52
24
  export function getTestPath(test) {
53
- var browser = test.browser,
54
- testName = test.testName,
55
- storyPath = test.storyPath;
56
- return [].concat(_toConsumableArray(storyPath), [testName, browser]).filter(isDefined);
25
+ const {
26
+ browser,
27
+ testName,
28
+ storyPath
29
+ } = test;
30
+ return [...storyPath, testName, browser].filter(isDefined);
57
31
  }
58
32
  export function getSuiteByPath(suite, path) {
59
- return path.reduce(function (suiteOrTest, pathToken) {
60
- return isTest(suiteOrTest) ? suiteOrTest : suiteOrTest === null || suiteOrTest === void 0 ? void 0 : suiteOrTest.children[pathToken];
61
- }, suite);
33
+ return path.reduce((suiteOrTest, pathToken) => isTest(suiteOrTest) ? suiteOrTest : suiteOrTest === null || suiteOrTest === void 0 ? void 0 : suiteOrTest.children[pathToken], suite);
62
34
  }
63
35
  export function getTestByPath(suite, path) {
64
36
  var _getSuiteByPath;
65
37
 
66
- var test = (_getSuiteByPath = getSuiteByPath(suite, path)) !== null && _getSuiteByPath !== void 0 ? _getSuiteByPath : suite;
38
+ const test = (_getSuiteByPath = getSuiteByPath(suite, path)) !== null && _getSuiteByPath !== void 0 ? _getSuiteByPath : suite;
67
39
  return isTest(test) ? test : null;
68
40
  }
69
41
  export function getTestsByStoryId(suite, storyId) {
70
- return Object.values(suite.children).filter(isDefined).flatMap(function (suiteOrTest) {
42
+ return Object.values(suite.children).filter(isDefined).flatMap(suiteOrTest => {
71
43
  if (isTest(suiteOrTest)) return suiteOrTest.storyId === storyId ? suiteOrTest : [];
72
44
  return getTestsByStoryId(suiteOrTest, storyId);
73
45
  }).filter(isDefined);
@@ -78,55 +50,38 @@ function checkTests(suiteOrTest, checked) {
78
50
 
79
51
  if (!isTest(suiteOrTest)) {
80
52
  suiteOrTest.indeterminate = false;
81
- Object.values(suiteOrTest.children).filter(isDefined).forEach(function (child) {
82
- return checkTests(child, checked);
83
- });
53
+ Object.values(suiteOrTest.children).filter(isDefined).forEach(child => checkTests(child, checked));
84
54
  }
85
55
  }
86
56
 
87
57
  function updateChecked(suite) {
88
- var children = Object.values(suite.children).filter(isDefined).filter(function (child) {
89
- return !child.skip;
90
- });
91
- var checkedEvery = children.every(function (test) {
92
- return test.checked;
93
- });
94
- var checkedSome = children.some(function (test) {
95
- return test.checked;
96
- });
97
- var indeterminate = children.some(function (test) {
98
- return isTest(test) ? false : test.indeterminate;
99
- }) || !checkedEvery && checkedSome;
100
- var checked = indeterminate || suite.checked == checkedEvery ? suite.checked : checkedEvery;
58
+ const children = Object.values(suite.children).filter(isDefined).filter(child => !child.skip);
59
+ const checkedEvery = children.every(test => test.checked);
60
+ const checkedSome = children.some(test => test.checked);
61
+ const indeterminate = children.some(test => isTest(test) ? false : test.indeterminate) || !checkedEvery && checkedSome;
62
+ const checked = indeterminate || suite.checked == checkedEvery ? suite.checked : checkedEvery;
101
63
  suite.checked = checked;
102
64
  suite.indeterminate = indeterminate;
103
65
  }
104
66
 
105
67
  export function checkSuite(suite, path, checked) {
106
- var subSuite = getSuiteByPath(suite, path);
68
+ const subSuite = getSuiteByPath(suite, path);
107
69
  if (subSuite) checkTests(subSuite, checked);
108
- path.slice(0, -1).map(function (_, index, tokens) {
109
- return tokens.slice(0, tokens.length - index);
110
- }).forEach(function (parentPath) {
111
- var parentSuite = getSuiteByPath(suite, parentPath);
70
+ path.slice(0, -1).map((_, index, tokens) => tokens.slice(0, tokens.length - index)).forEach(parentPath => {
71
+ const parentSuite = getSuiteByPath(suite, parentPath);
112
72
  if (isTest(parentSuite)) return;
113
73
  if (parentSuite) updateChecked(parentSuite);
114
74
  });
115
75
  updateChecked(suite);
116
76
  }
117
77
  export function treeifyTests(testsById) {
118
- var rootSuite = makeEmptySuiteNode();
78
+ const rootSuite = makeEmptySuiteNode();
119
79
  rootSuite.opened = true;
120
- Object.values(testsById).forEach(function (test) {
80
+ Object.values(testsById).forEach(test => {
121
81
  if (!test) return;
122
-
123
- var _getTestPath$reverse = getTestPath(test).reverse(),
124
- _getTestPath$reverse2 = _toArray(_getTestPath$reverse),
125
- browser = _getTestPath$reverse2[0],
126
- testPath = _getTestPath$reverse2.slice(1);
127
-
128
- var lastSuite = testPath.reverse().reduce(function (suite, token) {
129
- var subSuite = suite.children[token] || makeEmptySuiteNode([].concat(_toConsumableArray(suite.path), [token]));
82
+ const [browser, ...testPath] = getTestPath(test).reverse();
83
+ const lastSuite = testPath.reverse().reduce((suite, token) => {
84
+ const subSuite = suite.children[token] || makeEmptySuiteNode([...suite.path, token]);
130
85
  subSuite.status = calcStatus(subSuite.status, test.status);
131
86
  if (!test.skip) subSuite.skip = false;
132
87
  if (!subSuite.skip) suite.skip = false;
@@ -139,14 +94,14 @@ export function treeifyTests(testsById) {
139
94
 
140
95
  return subSuite;
141
96
  }, rootSuite);
142
- lastSuite.children[browser] = _objectSpread(_objectSpread({}, test), {}, {
97
+ lastSuite.children[browser] = { ...test,
143
98
  checked: true
144
- });
99
+ };
145
100
  });
146
101
  return rootSuite;
147
102
  }
148
103
  export function getCheckedTests(suite) {
149
- return Object.values(suite.children).filter(isDefined).flatMap(function (suiteOrTest) {
104
+ return Object.values(suite.children).filter(isDefined).flatMap(suiteOrTest => {
150
105
  if (isTest(suiteOrTest)) return suiteOrTest.checked ? suiteOrTest : [];
151
106
  if (!suiteOrTest.checked && !suiteOrTest.indeterminate) return [];
152
107
  return getCheckedTests(suiteOrTest);
@@ -155,87 +110,87 @@ export function getCheckedTests(suite) {
155
110
  export function updateTestStatus(suite, path, update) {
156
111
  var _suite$children$title;
157
112
 
158
- var title = path.shift();
113
+ const title = path.shift();
159
114
  if (!title) return;
160
- var suiteOrTest = (_suite$children$title = suite.children[title]) !== null && _suite$children$title !== void 0 ? _suite$children$title : suite.children[title] = _objectSpread(_objectSpread({}, path.length == 0 ? update : makeEmptySuiteNode([].concat(_toConsumableArray(suite.path), [title]))), {}, {
115
+ const suiteOrTest = (_suite$children$title = suite.children[title]) !== null && _suite$children$title !== void 0 ? _suite$children$title : suite.children[title] = { ...(path.length == 0 ? update : makeEmptySuiteNode([...suite.path, title])),
161
116
  checked: suite.checked
162
- });
117
+ };
163
118
 
164
119
  if (isTest(suiteOrTest)) {
165
- var _test$results;
166
-
167
- var test = suiteOrTest;
168
- var skip = update.skip,
169
- status = update.status,
170
- results = update.results,
171
- approved = update.approved;
120
+ const test = suiteOrTest;
121
+ const {
122
+ skip,
123
+ status,
124
+ results,
125
+ approved
126
+ } = update;
172
127
  if (isDefined(skip)) test.skip = skip;
173
128
  if (isDefined(status)) test.status = status;
174
- if (isDefined(results)) test.results ? (_test$results = test.results).push.apply(_test$results, _toConsumableArray(results)) : test.results = results;
175
- if (isDefined(approved)) Object.entries(approved).forEach(function (_ref) {
176
- var _ref2 = _slicedToArray(_ref, 2),
177
- image = _ref2[0],
178
- retry = _ref2[1];
179
-
129
+ if (isDefined(results)) test.results ? test.results.push(...results) : test.results = results;
130
+ if (isDefined(approved)) Object.entries(approved).forEach(_ref => {
131
+ let [image, retry] = _ref;
180
132
  return retry !== undefined && ((test.approved = test.approved || {})[image] = retry);
181
133
  });
182
134
  } else {
183
- var subSuite = suiteOrTest;
135
+ const subSuite = suiteOrTest;
184
136
  updateTestStatus(subSuite, path, update);
185
137
  }
186
138
 
187
- suite.skip = Object.values(suite.children).filter(isDefined).map(function (_ref3) {
188
- var skip = _ref3.skip;
139
+ suite.skip = Object.values(suite.children).filter(isDefined).map(_ref2 => {
140
+ let {
141
+ skip
142
+ } = _ref2;
189
143
  return skip;
190
144
  }).every(Boolean);
191
- suite.status = Object.values(suite.children).filter(isDefined).map(function (_ref4) {
192
- var status = _ref4.status;
145
+ suite.status = Object.values(suite.children).filter(isDefined).map(_ref3 => {
146
+ let {
147
+ status
148
+ } = _ref3;
193
149
  return status;
194
150
  }).reduce(calcStatus);
195
151
  }
196
152
  export function removeTests(suite, path) {
197
153
  var _suiteOrTest$children;
198
154
 
199
- var title = path.shift();
155
+ const title = path.shift();
200
156
  if (!title) return;
201
- var suiteOrTest = suite.children[title];
157
+ const suiteOrTest = suite.children[title];
202
158
  if (suiteOrTest && !isTest(suiteOrTest)) removeTests(suiteOrTest, path);
203
159
  if (isTest(suiteOrTest) || Object.keys((_suiteOrTest$children = suiteOrTest === null || suiteOrTest === void 0 ? void 0 : suiteOrTest.children) !== null && _suiteOrTest$children !== void 0 ? _suiteOrTest$children : {}).length == 0) delete suite.children[title];
204
160
  if (Object.keys(suite.children).length == 0) return;
205
161
  updateChecked(suite);
206
- suite.skip = Object.values(suite.children).filter(isDefined).map(function (_ref5) {
207
- var skip = _ref5.skip;
162
+ suite.skip = Object.values(suite.children).filter(isDefined).map(_ref4 => {
163
+ let {
164
+ skip
165
+ } = _ref4;
208
166
  return skip;
209
167
  }).every(Boolean);
210
- suite.status = Object.values(suite.children).filter(isDefined).map(function (_ref6) {
211
- var status = _ref6.status;
168
+ suite.status = Object.values(suite.children).filter(isDefined).map(_ref5 => {
169
+ let {
170
+ status
171
+ } = _ref5;
212
172
  return status;
213
173
  }).reduce(calcStatus);
214
174
  }
215
175
  export function filterTests(suite, filter) {
216
- var status = filter.status,
217
- subStrings = filter.subStrings;
176
+ const {
177
+ status,
178
+ subStrings
179
+ } = filter;
218
180
  if (!status && !subStrings.length) return suite;
219
-
220
- var filteredSuite = _objectSpread(_objectSpread({}, suite), {}, {
181
+ const filteredSuite = { ...suite,
221
182
  children: {}
222
- });
223
-
224
- Object.entries(suite.children).forEach(function (_ref7) {
225
- var _ref8 = _slicedToArray(_ref7, 2),
226
- title = _ref8[0],
227
- suiteOrTest = _ref8[1];
228
-
183
+ };
184
+ Object.entries(suite.children).forEach(_ref6 => {
185
+ let [title, suiteOrTest] = _ref6;
229
186
  if (!suiteOrTest || suiteOrTest.skip) return;
230
187
 
231
- if (!status && subStrings.some(function (subString) {
232
- return title.toLowerCase().includes(subString);
233
- })) {
188
+ if (!status && subStrings.some(subString => title.toLowerCase().includes(subString))) {
234
189
  filteredSuite.children[title] = suiteOrTest;
235
190
  } else if (isTest(suiteOrTest)) {
236
191
  if (status && suiteOrTest.status && ['pending', 'running', status].includes(suiteOrTest.status)) filteredSuite.children[title] = suiteOrTest;
237
192
  } else {
238
- var filteredSubSuite = filterTests(suiteOrTest, filter);
193
+ const filteredSubSuite = filterTests(suiteOrTest, filter);
239
194
  if (Object.keys(filteredSubSuite.children).length == 0) return;
240
195
  filteredSuite.children[title] = filteredSubSuite;
241
196
  }
@@ -243,7 +198,7 @@ export function filterTests(suite, filter) {
243
198
  return filteredSuite;
244
199
  }
245
200
  export function openSuite(suite, path, opened) {
246
- var subSuite = path.reduce(function (suiteOrTest, pathToken) {
201
+ const subSuite = path.reduce((suiteOrTest, pathToken) => {
247
202
  if (suiteOrTest && !isTest(suiteOrTest)) {
248
203
  if (opened) suiteOrTest.opened = opened;
249
204
  return suiteOrTest.children[pathToken];
@@ -253,24 +208,21 @@ export function openSuite(suite, path, opened) {
253
208
  }
254
209
  export function flattenSuite(suite) {
255
210
  if (!suite.opened) return [];
256
- return Object.entries(suite.children).flatMap(function (_ref9) {
257
- var _ref10 = _slicedToArray(_ref9, 2),
258
- title = _ref10[0],
259
- subSuite = _ref10[1];
260
-
211
+ return Object.entries(suite.children).flatMap(_ref7 => {
212
+ let [title, subSuite] = _ref7;
261
213
  return subSuite ? [{
262
- title: title,
214
+ title,
263
215
  suite: subSuite
264
- }].concat(_toConsumableArray(isTest(subSuite) ? [] : flattenSuite(subSuite))) : [];
216
+ }, ...(isTest(subSuite) ? [] : flattenSuite(subSuite))] : [];
265
217
  });
266
218
  }
267
219
  export function countTestsStatus(suite) {
268
- var successCount = 0;
269
- var failedCount = 0;
270
- var skippedCount = 0;
271
- var pendingCount = 0;
272
- var cases = Object.values(suite.children).filter(isDefined);
273
- var suiteOrTest;
220
+ let successCount = 0;
221
+ let failedCount = 0;
222
+ let skippedCount = 0;
223
+ let pendingCount = 0;
224
+ const cases = Object.values(suite.children).filter(isDefined);
225
+ let suiteOrTest;
274
226
 
275
227
  while (suiteOrTest = cases.pop()) {
276
228
  if (isTest(suiteOrTest)) {
@@ -279,15 +231,15 @@ export function countTestsStatus(suite) {
279
231
  if (suiteOrTest.status === 'failed') failedCount++;
280
232
  if (suiteOrTest.status === 'pending') pendingCount++;
281
233
  } else {
282
- cases.push.apply(cases, _toConsumableArray(Object.values(suiteOrTest.children).filter(isDefined)));
234
+ cases.push(...Object.values(suiteOrTest.children).filter(isDefined));
283
235
  }
284
236
  }
285
237
 
286
238
  return {
287
- successCount: successCount,
288
- failedCount: failedCount,
289
- skippedCount: skippedCount,
290
- pendingCount: pendingCount
239
+ successCount,
240
+ failedCount,
241
+ skippedCount,
242
+ pendingCount
291
243
  };
292
244
  }
293
245
  export function getConnectionUrl() {
@@ -295,50 +247,42 @@ export function getConnectionUrl() {
295
247
  }
296
248
  export function getImageUrl(path, imageName) {
297
249
  // path => [kind, story, test, browser]
298
- var browser = path.slice(-1)[0];
299
- var imagesUrl = window.location.host ? "".concat(window.location.protocol, "//").concat(getConnectionUrl()).concat(window.location.pathname == '/' ? '/report' : window.location.pathname.split('/').slice(0, -1).join('/'), "/").concat(encodeURI(path.slice(0, -1).join('/'))) : encodeURI(path.slice(0, -1).join('/'));
250
+ const browser = path.slice(-1)[0];
251
+ const imagesUrl = window.location.host ? "".concat(window.location.protocol, "//").concat(getConnectionUrl()).concat(window.location.pathname == '/' ? '/report' : window.location.pathname.split('/').slice(0, -1).join('/'), "/").concat(encodeURI(path.slice(0, -1).join('/'))) : encodeURI(path.slice(0, -1).join('/'));
300
252
  return imageName == browser ? imagesUrl : "".concat(imagesUrl, "/").concat(encodeURI(browser));
301
253
  }
302
254
  export function getBorderSize(element) {
303
255
  // NOTE Firefox returns empty string for `borderWidth` prop
304
- var borderSize = parseFloat(getComputedStyle(element).borderTopWidth);
256
+ const borderSize = parseFloat(getComputedStyle(element).borderTopWidth);
305
257
  return Number.isNaN(borderSize) ? 0 : borderSize;
306
258
  }
307
259
  export function useLoadImages(s1, s2, s3) {
308
- var _useState = useState(false),
309
- _useState2 = _slicedToArray(_useState, 2),
310
- loaded = _useState2[0],
311
- setLoaded = _useState2[1];
312
-
313
- useEffect(function () {
260
+ const [loaded, setLoaded] = useState(false);
261
+ useEffect(() => {
314
262
  setLoaded(false);
315
- void Promise.all([s1, s2, s3].map(function (url) {
316
- return new Promise(function (resolve) {
317
- var image = document.createElement('img');
318
- image.src = url;
319
- image.onload = resolve;
320
- image.onerror = resolve;
321
- });
322
- })).then(function () {
323
- return setLoaded(true);
324
- });
263
+ void Promise.all([s1, s2, s3].map(url => new Promise(resolve => {
264
+ const image = document.createElement('img');
265
+ image.src = url;
266
+ image.onload = resolve;
267
+ image.onerror = resolve;
268
+ }))).then(() => setLoaded(true));
325
269
  }, [s1, s2, s3]);
326
270
  return loaded;
327
271
  }
328
- /**
329
- * Uses the ResizeObserver API to observe changes within the given HTML Element DOM Rect.
330
- *
331
- * @returns dimensions of element's content box (which means without paddings and border width)
272
+ /**
273
+ * Uses the ResizeObserver API to observe changes within the given HTML Element DOM Rect.
274
+ *
275
+ * @returns dimensions of element's content box (which means without paddings and border width)
332
276
  */
333
277
 
334
278
  export function useResizeObserver(elementRef, onResize) {
335
- var debounceTimeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16;
336
- var observerRef = useRef(null);
337
- useEffect(function () {
279
+ let debounceTimeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16;
280
+ const observerRef = useRef(null);
281
+ useEffect(() => {
338
282
  if (!elementRef.current) return;
339
283
  observerRef.current = new ResizeObserver(onResize);
340
284
  observerRef.current.observe(elementRef.current);
341
- return function () {
285
+ return () => {
342
286
  var _observerRef$current;
343
287
 
344
288
  return (_observerRef$current = observerRef.current) === null || _observerRef$current === void 0 ? void 0 : _observerRef$current.disconnect();
@@ -346,79 +290,64 @@ export function useResizeObserver(elementRef, onResize) {
346
290
  }, [debounceTimeout, elementRef, onResize]);
347
291
  }
348
292
  export function useApplyScale(imageRef, scale, dependency) {
349
- useLayoutEffect(function () {
293
+ useLayoutEffect(() => {
350
294
  if (!imageRef.current) return;
351
- var image = imageRef.current;
352
- var borderSize = getBorderSize(image);
295
+ const image = imageRef.current;
296
+ const borderSize = getBorderSize(image);
353
297
  image.style.height = "".concat(image.naturalHeight * scale + borderSize * 2, "px");
354
298
  }, [imageRef, scale, dependency]);
355
299
  }
356
300
  export function useCalcScale(diffImageRef, loaded) {
357
- var _useState3 = useState(1),
358
- _useState4 = _slicedToArray(_useState3, 2),
359
- scale = _useState4[0],
360
- setScale = _useState4[1];
361
-
362
- var calcScale = useCallback(function () {
363
- var diffImage = diffImageRef.current;
301
+ const [scale, setScale] = useState(1);
302
+ const calcScale = useCallback(() => {
303
+ const diffImage = diffImageRef.current;
364
304
  if (!diffImage || !loaded) return setScale(1);
365
- var borderSize = getBorderSize(diffImage);
366
- var ratio = (diffImage.getBoundingClientRect().width - borderSize * 2) / diffImage.naturalWidth;
305
+ const borderSize = getBorderSize(diffImage);
306
+ const ratio = (diffImage.getBoundingClientRect().width - borderSize * 2) / diffImage.naturalWidth;
367
307
  setScale(Math.min(1, ratio));
368
308
  }, [diffImageRef, loaded]);
369
309
  useResizeObserver(diffImageRef, calcScale);
370
310
  useLayoutEffect(calcScale, [calcScale]);
371
311
  return scale;
372
312
  }
373
- var CREEVEY_THEME = 'Creevey_theme';
313
+ const CREEVEY_THEME = 'Creevey_theme';
374
314
 
375
315
  function isTheme(theme) {
376
316
  return isDefined(theme) && Object.prototype.hasOwnProperty.call(themes, theme);
377
317
  }
378
318
 
379
319
  function initialTheme() {
380
- var theme = localStorage.getItem(CREEVEY_THEME);
320
+ const theme = localStorage.getItem(CREEVEY_THEME);
381
321
  return isTheme(theme) ? theme : 'light';
382
322
  }
383
323
 
384
324
  export function useTheme() {
385
- var _useState5 = useState(initialTheme()),
386
- _useState6 = _slicedToArray(_useState5, 2),
387
- theme = _useState6[0],
388
- setTheme = _useState6[1];
389
-
390
- useEffect(function () {
325
+ const [theme, setTheme] = useState(initialTheme());
326
+ useEffect(() => {
391
327
  localStorage.setItem(CREEVEY_THEME, theme);
392
328
  }, [theme]);
393
329
  return [theme, setTheme];
394
330
  }
395
331
  export function setSearchParams(testPath) {
396
- var pageUrl = "?".concat(stringify({
397
- testPath: testPath
332
+ const pageUrl = "?".concat(stringify({
333
+ testPath
398
334
  }));
399
335
  window.history.pushState({
400
- testPath: testPath
336
+ testPath
401
337
  }, '', pageUrl);
402
338
  }
403
339
  export function getTestPathFromSearch() {
404
- var _parse = parse(window.location.search.slice(1)),
405
- testPath = _parse.testPath; //@ts-expect-error: This expression is not callable.
340
+ const {
341
+ testPath
342
+ } = parse(window.location.search.slice(1)); //@ts-expect-error: This expression is not callable.
406
343
 
407
-
408
- if (Array.isArray(testPath) && testPath.every(function (token) {
409
- return typeof token == 'string';
410
- })) {
344
+ if (Array.isArray(testPath) && testPath.every(token => typeof token == 'string')) {
411
345
  return testPath;
412
346
  }
413
347
 
414
348
  return [];
415
349
  }
416
350
  export function useForceUpdate() {
417
- var _useState7 = useState({}),
418
- _useState8 = _slicedToArray(_useState7, 2),
419
- update = _useState8[1];
420
-
421
- return useCallback(function () {
422
- return update({});
423
- }, []);
351
+ const [, update] = useState({});
352
+ return useCallback(() => update({}), []);
424
353
  }
@@ -1,6 +1,6 @@
1
- export var VIEW_MODE_KEY = 'Creevey_view_mode';
2
- export var viewModes = ['side-by-side', 'swap', 'slide', 'blend'];
3
- export var getViewMode = function getViewMode() {
4
- var item = localStorage.getItem(VIEW_MODE_KEY);
1
+ export const VIEW_MODE_KEY = 'Creevey_view_mode';
2
+ export const viewModes = ['side-by-side', 'swap', 'slide', 'blend'];
3
+ export const getViewMode = () => {
4
+ const item = localStorage.getItem(VIEW_MODE_KEY);
5
5
  return item && viewModes.includes(item) ? item : 'side-by-side';
6
6
  };
@@ -8,10 +8,8 @@ import { setDefaultLevel, levels } from 'loglevel';
8
8
  import { logger } from './server/logger';
9
9
 
10
10
  function shutdownOnException(reason) {
11
- var _reason$stack;
12
-
13
11
  if (isShuttingDown.current) return;
14
- const error = reason instanceof Error ? (_reason$stack = reason.stack) !== null && _reason$stack !== void 0 ? _reason$stack : reason.message : reason;
12
+ const error = reason instanceof Error ? reason.stack ?? reason.message : reason;
15
13
  logger.error(error);
16
14
  process.exitCode = -1;
17
15
  if (cluster.isWorker) emitWorkerMessage({
@@ -20,13 +18,13 @@ function shutdownOnException(reason) {
20
18
  error
21
19
  }
22
20
  });
23
- if (cluster.isMaster && !isShuttingDown.current) void shutdownWorkers();
21
+ if (cluster.isPrimary && !isShuttingDown.current) void shutdownWorkers();
24
22
  }
25
23
 
26
24
  process.on('uncaughtException', shutdownOnException);
27
25
  process.on('unhandledRejection', shutdownOnException);
28
26
  if (cluster.isWorker) process.on('SIGINT', noop);
29
- if (cluster.isMaster) process.on('SIGINT', shutdown);
27
+ if (cluster.isPrimary) process.on('SIGINT', shutdown);
30
28
  const argv = minimist(process.argv.slice(2), {
31
29
  string: ['browser', 'config', 'reporter', 'reportDir', 'screenDir'],
32
30
  boolean: ['debug', 'ui', 'saveReport', 'webpack', 'tests'],
package/lib/esm/index.js CHANGED
@@ -1,6 +1,4 @@
1
- export * from './types'; // export * from './client/addon/withCreevey';
2
- // export * from './client/addon/readyForCapture';
3
-
1
+ export * from './types';
4
2
  export { loadStories as browserStoriesProvider } from './server/storybook/providers/browser';
5
3
  export { loadStories as nodejsStoriesProvider } from './server/storybook/providers/nodejs';
6
4
  export { loadStories as hybridStoriesProvider } from './server/storybook/providers/hybrid';
@@ -1,4 +1,4 @@
1
- import cluster, { isMaster } from 'cluster';
1
+ import cluster from 'cluster';
2
2
  import { isDockerMessage } from '../types';
3
3
  import { subscribeOn, sendDockerMessage, emitDockerMessage } from './messages';
4
4
  import { isInsideDocker, LOCALHOST_REGEXP } from './utils';
@@ -91,7 +91,7 @@ export async function runImage(image, args, options, debug) {
91
91
  });
92
92
  }
93
93
  export default async function (config, browser, startContainer) {
94
- if (isMaster) {
94
+ if (cluster.isPrimary) {
95
95
  const host = await startContainer();
96
96
  let gridUrl = 'http://localhost:4444/wd/hub';
97
97
  gridUrl = isInsideDocker ? gridUrl.replace(LOCALHOST_REGEXP, host) : gridUrl;
@@ -46,7 +46,7 @@ export default async function (options) {
46
46
  return (await import('./loaders/webpack/compile')).default(config, options);
47
47
  }
48
48
 
49
- case cluster.isMaster:
49
+ case cluster.isPrimary:
50
50
  {
51
51
  logger.info('Starting Master Process');
52
52
  const resolveApi = (await import('./master/server')).default(config.reportDir, port, ui);
@@ -7,9 +7,7 @@ const reexportedStories = new Map();
7
7
  export default function () {
8
8
  return {
9
9
  pre() {
10
- var _this$opts$parents;
11
-
12
- const parents = (_this$opts$parents = this.opts.parents()) !== null && _this$opts$parents !== void 0 ? _this$opts$parents : [];
10
+ const parents = this.opts.parents() ?? [];
13
11
  const story = this.opts.story();
14
12
  this.resourcePath = this.filename;
15
13
  this.fileType = FileType.Invalid; // eslint-disable-next-line @typescript-eslint/no-explicit-any