@stencil/core 4.23.2 → 4.24.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.
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v4.23.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v4.24.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
 
@@ -803,7 +803,9 @@ var require_core = __commonJS({
803
803
  "node:readline/promises": ">= 17",
804
804
  repl: true,
805
805
  "node:repl": [">= 14.18 && < 15", ">= 16"],
806
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
806
807
  smalloc: ">= 0.11.5 && < 3",
808
+ "node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
807
809
  _stream_duplex: ">= 0.9.4",
808
810
  "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
809
811
  _stream_transform: ">= 0.9.4",
@@ -830,6 +832,8 @@ var require_core = __commonJS({
830
832
  "node:sys": [">= 14.18 && < 15", ">= 16"],
831
833
  "test/reporters": ">= 19.9 && < 20.2",
832
834
  "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
835
+ "test/mock_loader": ">= 22.3 && < 22.7",
836
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
833
837
  "node:test": [">= 16.17 && < 17", ">= 18"],
834
838
  timers: true,
835
839
  "node:timers": [">= 14.18 && < 15", ">= 16"],
@@ -1325,7 +1329,9 @@ var require_core2 = __commonJS({
1325
1329
  "node:readline/promises": ">= 17",
1326
1330
  repl: true,
1327
1331
  "node:repl": [">= 14.18 && < 15", ">= 16"],
1332
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
1328
1333
  smalloc: ">= 0.11.5 && < 3",
1334
+ "node:sqlite": ">= 23.4",
1329
1335
  _stream_duplex: ">= 0.9.4",
1330
1336
  "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
1331
1337
  _stream_transform: ">= 0.9.4",
@@ -1352,6 +1358,8 @@ var require_core2 = __commonJS({
1352
1358
  "node:sys": [">= 14.18 && < 15", ">= 16"],
1353
1359
  "test/reporters": ">= 19.9 && < 20.2",
1354
1360
  "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
1361
+ "test/mock_loader": ">= 22.3 && < 22.7",
1362
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
1355
1363
  "node:test": [">= 16.17 && < 17", ">= 18"],
1356
1364
  timers: true,
1357
1365
  "node:timers": [">= 14.18 && < 15", ">= 16"],
@@ -1703,7 +1711,6 @@ ${e}`);
1703
1711
  config.logger.debug(`puppeteer slowMo: ${config.testing.browserSlowMo}`);
1704
1712
  }
1705
1713
  const connectOpts = {
1706
- ignoreHTTPSErrors: true,
1707
1714
  slowMo: config.testing.browserSlowMo
1708
1715
  };
1709
1716
  let browser;
@@ -1715,6 +1722,7 @@ ${e}`);
1715
1722
  } else {
1716
1723
  const launchOpts = {
1717
1724
  args: config.testing.browserArgs,
1725
+ channel: config.testing.browserChannel,
1718
1726
  headless: config.testing.browserHeadless,
1719
1727
  devtools: config.testing.browserDevtools,
1720
1728
  ...connectOpts
@@ -1735,8 +1743,7 @@ async function connectBrowser() {
1735
1743
  return null;
1736
1744
  }
1737
1745
  const connectOpts = {
1738
- browserWSEndpoint: wsEndpoint,
1739
- ignoreHTTPSErrors: true
1746
+ browserWSEndpoint: wsEndpoint
1740
1747
  };
1741
1748
  const puppeteer = require(env2.__STENCIL_PUPPETEER_MODULE__);
1742
1749
  return await puppeteer.connect(connectOpts);
@@ -6901,14 +6908,20 @@ var validateTesting = (config, diagnostics) => {
6901
6908
  } else {
6902
6909
  configPathDir = config.rootDir;
6903
6910
  }
6904
- if (typeof config.flags.headless === "boolean" || config.flags.headless === "new") {
6911
+ if (typeof config.flags.headless === "boolean" || config.flags.headless === "shell") {
6905
6912
  testing.browserHeadless = config.flags.headless;
6906
- } else if (typeof testing.browserHeadless !== "boolean" && testing.browserHeadless !== "new") {
6907
- testing.browserHeadless = true;
6913
+ } else if (typeof testing.browserHeadless !== "boolean" && testing.browserHeadless !== "shell") {
6914
+ testing.browserHeadless = "shell";
6915
+ }
6916
+ if (typeof testing.browserHeadless === "boolean" && testing.browserHeadless) {
6917
+ throw new Error(`Setting "browserHeadless" config to \`true\` is not supported anymore, please set it to "shell"!`);
6908
6918
  }
6909
6919
  if (!testing.browserWaitUntil) {
6910
6920
  testing.browserWaitUntil = "load";
6911
6921
  }
6922
+ if (!isString(testing.browserChannel)) {
6923
+ testing.browserChannel = "chrome";
6924
+ }
6912
6925
  testing.browserArgs = testing.browserArgs || [];
6913
6926
  addTestingConfigOption(testing.browserArgs, "--font-render-hinting=medium");
6914
6927
  addTestingConfigOption(testing.browserArgs, "--incognito");
@@ -6916,7 +6929,7 @@ var validateTesting = (config, diagnostics) => {
6916
6929
  addTestingConfigOption(testing.browserArgs, "--no-sandbox");
6917
6930
  addTestingConfigOption(testing.browserArgs, "--disable-setuid-sandbox");
6918
6931
  addTestingConfigOption(testing.browserArgs, "--disable-dev-shm-usage");
6919
- testing.browserHeadless = testing.browserHeadless === "new" ? "new" : true;
6932
+ testing.browserHeadless = "shell";
6920
6933
  } else if (config.flags.devtools || testing.browserDevtools) {
6921
6934
  testing.browserDevtools = true;
6922
6935
  testing.browserHeadless = false;
@@ -10326,6 +10339,7 @@ function wait(ms) {
10326
10339
  }
10327
10340
 
10328
10341
  // src/testing/puppeteer/puppeteer-page.ts
10342
+ var DEFAULT_LOAD_TIMEOUT = 10 * 1e3;
10329
10343
  var env = process.env;
10330
10344
  async function newE2EPage(opts = {}) {
10331
10345
  if (!global.__NEW_TEST_PAGE__) {
@@ -10536,11 +10550,11 @@ async function e2eSetContent(page, html, options = {}) {
10536
10550
  await waitForStencil(page, options);
10537
10551
  }
10538
10552
  async function waitForStencil(page, options) {
10553
+ const timeout = typeof options.timeout === "number" ? options.timeout : DEFAULT_LOAD_TIMEOUT;
10539
10554
  try {
10540
- const timeout = typeof options.timeout === "number" ? options.timeout : 4750;
10541
10555
  await page.waitForFunction("window.stencilAppLoaded", { timeout });
10542
10556
  } catch (e) {
10543
- throw new Error(`App did not load in allowed time. Please ensure the content loads a stencil application.`);
10557
+ throw new Error(`App did not load within ${timeout}ms. Please ensure the content loads a stencil application.`);
10544
10558
  }
10545
10559
  }
10546
10560
  async function waitForChanges(page) {
@@ -10586,11 +10600,7 @@ async function waitForChanges(page) {
10586
10600
  if (page.isClosed()) {
10587
10601
  return;
10588
10602
  }
10589
- if (typeof page.waitForTimeout === "function") {
10590
- await page.waitForTimeout(100);
10591
- } else {
10592
- await page.waitFor(100);
10593
- }
10603
+ await new Promise((r) => setTimeout(r, 100));
10594
10604
  await Promise.all(page._e2eElements.map((elm) => elm.e2eSync()));
10595
10605
  } catch (e) {
10596
10606
  }
@@ -10598,12 +10608,11 @@ async function waitForChanges(page) {
10598
10608
  function consoleMessage(c) {
10599
10609
  const msg = serializeConsoleMessage(c);
10600
10610
  const type = c.type();
10601
- const normalizedType = type === "warning" ? "warn" : type;
10602
- if (normalizedType === "debug") {
10611
+ if (type === "debug") {
10603
10612
  return;
10604
10613
  }
10605
- if (typeof console[normalizedType] === "function") {
10606
- console[normalizedType](msg);
10614
+ if (typeof console[type] === "function") {
10615
+ console[type](msg);
10607
10616
  } else {
10608
10617
  console.log(type, msg);
10609
10618
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "4.23.2",
3
+ "version": "4.24.0",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",