@stencil/playwright 0.2.1 → 0.2.2-dev.1763311619.b0d6b9d

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/dist/index.cjs CHANGED
@@ -138,38 +138,28 @@ var require_fast_deep_equal = __commonJS({
138
138
  "node_modules/fast-deep-equal/index.js"(exports2, module2) {
139
139
  "use strict";
140
140
  module2.exports = function equal(a, b) {
141
- if (a === b)
142
- return true;
141
+ if (a === b) return true;
143
142
  if (a && b && typeof a == "object" && typeof b == "object") {
144
- if (a.constructor !== b.constructor)
145
- return false;
143
+ if (a.constructor !== b.constructor) return false;
146
144
  var length, i, keys;
147
145
  if (Array.isArray(a)) {
148
146
  length = a.length;
149
- if (length != b.length)
150
- return false;
147
+ if (length != b.length) return false;
151
148
  for (i = length; i-- !== 0; )
152
- if (!equal(a[i], b[i]))
153
- return false;
149
+ if (!equal(a[i], b[i])) return false;
154
150
  return true;
155
151
  }
156
- if (a.constructor === RegExp)
157
- return a.source === b.source && a.flags === b.flags;
158
- if (a.valueOf !== Object.prototype.valueOf)
159
- return a.valueOf() === b.valueOf();
160
- if (a.toString !== Object.prototype.toString)
161
- return a.toString() === b.toString();
152
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
153
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
154
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
162
155
  keys = Object.keys(a);
163
156
  length = keys.length;
164
- if (length !== Object.keys(b).length)
165
- return false;
157
+ if (length !== Object.keys(b).length) return false;
166
158
  for (i = length; i-- !== 0; )
167
- if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
168
- return false;
159
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
169
160
  for (i = length; i-- !== 0; ) {
170
161
  var key = keys[i];
171
- if (!equal(a[key], b[key]))
172
- return false;
162
+ if (!equal(a[key], b[key])) return false;
173
163
  }
174
164
  return true;
175
165
  }
@@ -179,8 +169,8 @@ var require_fast_deep_equal = __commonJS({
179
169
  });
180
170
 
181
171
  // src/index.ts
182
- var src_exports = {};
183
- __export(src_exports, {
172
+ var index_exports = {};
173
+ __export(index_exports, {
184
174
  createConfig: () => createConfig,
185
175
  goto: () => goto,
186
176
  locator: () => locator,
@@ -190,7 +180,7 @@ __export(src_exports, {
190
180
  test: () => test,
191
181
  waitForChanges: () => waitForChanges
192
182
  });
193
- module.exports = __toCommonJS(src_exports);
183
+ module.exports = __toCommonJS(index_exports);
194
184
 
195
185
  // src/create-config.ts
196
186
  var import_deepmerge = __toESM(require_cjs());
@@ -242,6 +232,12 @@ var Queue = class {
242
232
  this.#size--;
243
233
  return current.value;
244
234
  }
235
+ peek() {
236
+ if (!this.#head) {
237
+ return;
238
+ }
239
+ return this.#head.value;
240
+ }
245
241
  clear() {
246
242
  this.#head = void 0;
247
243
  this.#tail = void 0;
@@ -257,6 +253,11 @@ var Queue = class {
257
253
  current = current.next;
258
254
  }
259
255
  }
256
+ *drain() {
257
+ while (this.#head) {
258
+ yield this.dequeue();
259
+ }
260
+ }
260
261
  };
261
262
 
262
263
  // node_modules/p-locate/node_modules/p-limit/index.js
@@ -348,12 +349,12 @@ var typeMappings = {
348
349
  file: "isFile"
349
350
  };
350
351
  function checkType(type) {
351
- if (Object.hasOwnProperty.call(typeMappings, type)) {
352
+ if (type === "both" || Object.hasOwn(typeMappings, type)) {
352
353
  return;
353
354
  }
354
355
  throw new Error(`Invalid type specified: ${type}`);
355
356
  }
356
- var matchType = (type, stat) => stat[typeMappings[type]]();
357
+ var matchType = (type, stat) => type === "both" ? stat.isFile() || stat.isDirectory() : stat[typeMappings[type]]();
357
358
  var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
358
359
  async function locatePath(paths, {
359
360
  cwd = import_node_process.default.cwd(),
@@ -376,17 +377,21 @@ async function locatePath(paths, {
376
377
  }
377
378
 
378
379
  // node_modules/unicorn-magic/node.js
380
+ var import_node_util = require("node:util");
381
+ var import_node_child_process = require("node:child_process");
379
382
  var import_node_url2 = require("node:url");
383
+ var execFileOriginal = (0, import_node_util.promisify)(import_node_child_process.execFile);
380
384
  function toPath2(urlOrPath) {
381
385
  return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
382
386
  }
387
+ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
383
388
 
384
389
  // node_modules/find-up/index.js
385
390
  var findUpStop = Symbol("findUpStop");
386
391
  async function findUpMultiple(name, options = {}) {
387
392
  let directory = import_node_path2.default.resolve(toPath2(options.cwd) ?? "");
388
393
  const { root } = import_node_path2.default.parse(directory);
389
- const stopAt = import_node_path2.default.resolve(directory, toPath2(options.stopAt ?? root));
394
+ const stopAt = import_node_path2.default.resolve(directory, toPath2(options.stopAt) ?? root);
390
395
  const limit = options.limit ?? Number.POSITIVE_INFINITY;
391
396
  const paths = [name].flat();
392
397
  const runMatcher = async (locateOptions) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/deepmerge/dist/cjs.js", "../node_modules/fast-deep-equal/index.js", "../src/index.ts", "../src/create-config.ts", "../src/load-config-meta.ts", "../node_modules/find-up/index.js", "../node_modules/locate-path/index.js", "../node_modules/p-locate/node_modules/yocto-queue/index.js", "../node_modules/p-locate/node_modules/p-limit/index.js", "../node_modules/p-locate/index.js", "../node_modules/unicorn-magic/node.js", "../src/matchers/to-have-first-received-event-detail.ts", "../src/matchers/to-have-nth-received-event-detail.ts", "../src/matchers/to-have-received-event.ts", "../src/matchers/to-have-received-event-detail.ts", "../src/matchers/to-have-received-event-times.ts", "../src/matchers/index.ts", "../src/page/utils/goto.ts", "../src/page/event-spy.ts", "../src/page/utils/locator.ts", "../src/page/utils/set-content.ts", "../src/page/utils/spy-on-event.ts", "../src/page/utils/wait-for-changes.ts", "../src/playwright-page.ts"],
4
- "sourcesContent": ["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "export * from './create-config';\nexport * from './matchers';\nexport type { EventSpy } from './page/event-spy';\nexport * from './page/utils';\nexport * from './playwright-declarations';\nexport * from './playwright-page';\nexport * from './test-expect';\n", "import { PlaywrightTestConfig } from '@playwright/test';\nimport merge from 'deepmerge';\n\nimport { loadConfigMeta } from './load-config-meta';\nimport { ProcessConstants } from './process-constants';\n\n// Recursively apply the `Partial` type to all nested object types in the provided generic type\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>;\n }\n : T;\n\n/**\n * Helper function to easily create a Playwright config for Stencil projects. This function will\n * automatically load the Stencil config meta to set default values for the Playwright config respecting the\n * Stencil dev server configuration, and set the Stencil namespace and entry path as environment variables for use\n * in the Playwright tests.\n *\n * @param overrides Values to override in the default config. Any Playwright config option can be overridden.\n * @returns A {@link PlaywrightTestConfig} object\n */\nexport const createConfig = async (\n overrides: DeepPartial<PlaywrightTestConfig> = {},\n): Promise<PlaywrightTestConfig> => {\n const { webServerUrl, baseURL, stencilEntryPath, stencilNamespace } = await loadConfigMeta();\n\n // Set the Stencil namespace and entry path as environment variables so we can use them when constructing\n // the HTML `head` content in the `setContent` function. This is just an easy way for us to maintain some context\n // about the current Stencil project's configuration.\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n\n return merge<DeepPartial<PlaywrightTestConfig>>(\n {\n testMatch: '*.e2e.ts',\n use: {\n baseURL,\n },\n webServer: {\n command: 'stencil build --dev --watch --serve --no-open',\n url: webServerUrl,\n reuseExistingServer: !!!process.env.CI,\n // Max time to wait for dev server to start before aborting, defaults to 60000 (60 seconds)\n timeout: undefined,\n // Pipe the dev server output to the console\n // Gives visibility to the developer if the dev server fails to start\n stdout: 'pipe',\n },\n },\n overrides,\n ) as PlaywrightTestConfig;\n};\n", "import { loadConfig } from '@stencil/core/compiler';\nimport { OutputTargetWww } from '@stencil/core/internal';\nimport { findUp } from 'find-up';\nimport { existsSync } from 'fs';\nimport { relative } from 'path';\n\nconst DEFAULT_NAMESPACE = 'app';\nconst DEFAULT_BASE_URL = 'http://localhost:3333';\nconst DEFAULT_WEB_SERVER_URL = `${DEFAULT_BASE_URL}/ping`;\n\nconst DEFAULT_STENCIL_ENTRY_PATH_PREFIX = './build';\nconst DEFAULT_STENCIL_ENTRY_PATH = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${DEFAULT_NAMESPACE}`;\n\n/**\n * For internal use only.\n *\n * Loads and validates the project's Stencil config.\n *\n * @returns The processed Stencil config metadata.\n */\nexport const loadConfigMeta = async () => {\n let baseURL = DEFAULT_BASE_URL;\n let webServerUrl = DEFAULT_WEB_SERVER_URL;\n let stencilNamespace = DEFAULT_NAMESPACE;\n let stencilEntryPath = DEFAULT_STENCIL_ENTRY_PATH;\n\n // Find the Stencil config file in either the current directory, or the nearest ancestor directory.\n // This allows for the Playwright config to exist in a different directory than the Stencil config.\n const stencilConfigPath = await findUp(['stencil.config.ts', 'stencil.config.js']);\n\n // Only load the Stencil config if the user has created one\n if (stencilConfigPath && existsSync(stencilConfigPath)) {\n const { devServer, fsNamespace, outputTargets } = (await loadConfig({ configPath: stencilConfigPath })).config;\n\n // Grab the WWW output target. If one doesn't exist, we'll throw a warning and roll\n // with the default value for the entry path.\n const wwwTarget = outputTargets.find((o): o is OutputTargetWww => o.type === 'www');\n if (wwwTarget) {\n // Get path from dev-server root to www\n let relativePath = relative(devServer.root!, wwwTarget.dir!);\n relativePath = relativePath === '' ? '.' : relativePath;\n if (!relativePath.startsWith('.')) {\n relativePath = `./${relativePath}`;\n }\n\n stencilEntryPath = `${relativePath}/build/${fsNamespace}`;\n } else {\n // Make a best guess at the entry path\n stencilEntryPath = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${fsNamespace}`;\n\n console.warn(\n `No \"www\" output target found in the Stencil config. Using default entry path: \"${stencilEntryPath}\". Tests using 'setContent' may fail to execute.`,\n );\n }\n\n baseURL = `${devServer.protocol}://${devServer.address}:${devServer.port}`;\n webServerUrl = `${baseURL}${devServer.pingRoute ?? ''}`;\n stencilNamespace = fsNamespace;\n } else {\n const msg = stencilConfigPath\n ? `Unable to find your project's Stencil configuration file, starting from '${stencilConfigPath}'. Falling back to defaults.`\n : `No Stencil config file was found matching the glob 'stencil.config.{ts,js}' in the current or parent directories. Falling back to defaults.`;\n\n console.warn(msg);\n }\n\n return {\n baseURL,\n webServerUrl,\n stencilNamespace,\n stencilEntryPath,\n };\n};\n", "import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n", "import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n", "/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n", "import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n", "import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveFirstReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.firstEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveNthReceivedEventDetail(eventSpy: EventSpy, index: number, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const event = eventSpy.events[index];\n\n if (event === null || event === undefined) {\n return {\n message: () => `event at index ${index} was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(event.detail, eventDetail);\n\n expect(event.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEvent(eventSpy: EventSpy) {\n if (eventSpy === undefined || eventSpy === null) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n const pass = eventSpy.events.length > 0;\n if (pass) {\n return {\n message: () => `expected to have called ${eventSpy.eventName} event`,\n pass: true,\n };\n }\n return {\n message: () => `expected to have not called ${eventSpy.eventName} event`,\n pass: false,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.lastEvent === null || eventSpy.lastEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.lastEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventTimes(eventSpy: EventSpy, count: number) {\n if (!eventSpy) {\n return {\n message: () => `toHaveReceivedEventTimes event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventTimes did not receive an event spy`,\n pass: false,\n };\n }\n\n const pass = eventSpy.length === count;\n\n return {\n message: () =>\n `expected event \"${eventSpy.eventName}\" to have been called ${count} times, but it was called ${eventSpy.events.length} times`,\n pass: pass,\n };\n}\n", "import { toHaveFirstReceivedEventDetail } from './to-have-first-received-event-detail';\nimport { toHaveNthReceivedEventDetail } from './to-have-nth-received-event-detail';\nimport { toHaveReceivedEvent } from './to-have-received-event';\nimport { toHaveReceivedEventDetail } from './to-have-received-event-detail';\nimport { toHaveReceivedEventTimes } from './to-have-received-event-times';\n\nexport const matchers = {\n toHaveReceivedEvent,\n toHaveReceivedEventDetail,\n toHaveReceivedEventTimes,\n toHaveFirstReceivedEventDetail,\n toHaveNthReceivedEventDetail,\n};\n", "/* eslint-disable jsdoc/require-param */\n/* eslint-disable jsdoc/require-returns */\nimport type { Page } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * This is an extended version of Playwright's `page.goto` method. In addition to performing\n * the normal `page.goto` work, this code also automatically waits for the Stencil components\n * to be hydrated before proceeding with the test.\n */\nexport const goto = async (page: Page, url: string, originalFn: typeof page.goto, options?: E2EPageOptions) => {\n const result = await Promise.all([\n page.waitForFunction(() => (window as any).testAppLoaded === true, {\n // This timeout was taken from the existing Playwright adapter in the Ionic Framework repository.\n // They tested this number and found it to be a reliable timeout for the Stencil components to be hydrated.\n timeout: 4750,\n }),\n originalFn(url, options),\n ]);\n\n return result[1];\n};\n", "import type { JSHandle } from '@playwright/test';\n\nimport type { E2EPage } from '../playwright-declarations';\n\n/**\n * The EventSpy class allows developers to listen for a particular event emission and\n * pass/fail the test based on whether or not the event was emitted.\n * Based off https://github.com/ionic-team/stencil/blob/16b8ea4dabb22024872a38bc58ba1dcf1c7cc25b/src/testing/puppeteer/puppeteer-events.ts#L64\n */\nexport class EventSpy {\n /**\n * Keeping track of a cursor ensures that no two spy.next() calls point to the same event.\n */\n private cursor = 0;\n private queuedHandler: (() => void)[] = [];\n public events: CustomEvent[] = [];\n\n constructor(public eventName: string) {}\n\n get length() {\n return this.events.length;\n }\n\n get firstEvent() {\n return this.events[0] ?? null;\n }\n\n get lastEvent() {\n return this.events[this.events.length - 1] ?? null;\n }\n\n public next() {\n const { cursor } = this;\n this.cursor++;\n\n const next = this.events[cursor];\n if (next !== undefined) {\n return Promise.resolve(next);\n } else {\n /**\n * If the event has not already been emitted, then add it to the queuedHandler.\n * When the event is emitted, the push method is called which results in the Promise below being resolved.\n */\n let resolve: () => void;\n const promise = new Promise<void>((r) => (resolve = r));\n // @ts-ignore\n this.queuedHandler.push(resolve);\n\n return promise.then(() => this.events[cursor]);\n }\n }\n\n public push(ev: CustomEvent) {\n this.events.push(ev);\n const next = this.queuedHandler.shift();\n if (next) {\n next();\n }\n }\n}\n\n/**\n * For internal use only.\n *\n * Initializes information required to spy on events.\n * The stencilOnEvent function is called in the context of the current page.\n * This lets us respond to an event listener created within the page itself.\n *\n * @param page The Playwright test page object.\n */\nexport const initPageEvents = async (page: E2EPage) => {\n page._e2eEventsIds = 0;\n page._e2eEvents = new Map();\n\n await page.exposeFunction('stencilOnEvent', (id: number, ev: any) => {\n const context = page._e2eEvents.get(id);\n if (context) {\n context.callback(ev);\n }\n });\n};\n\n/**\n * For internal use only.\n *\n * Adds a new event listener in the current page context to updates\n * the _e2eEvents map when an event is fired.\n *\n * @param page The Playwright test page object.\n * @param elmHandle A {@link JSHandle} representing the element to listen for events on.\n * @param eventName The event name to listen for.\n * @param callback The callback to execute when the event is fired.\n */\nexport const addE2EListener = async (\n page: E2EPage,\n elmHandle: JSHandle,\n eventName: string,\n callback: (ev: any) => void,\n) => {\n const id = page._e2eEventsIds++;\n page._e2eEvents.set(id, {\n eventName,\n callback,\n });\n\n await elmHandle.evaluate(\n (elm, [eventName, id]) => {\n (window as any).stencilSerializeEventTarget = (target: any) => {\n // BROWSER CONTEXT\n if (!target) {\n return null;\n }\n if (target === window) {\n return { serializedWindow: true };\n }\n if (target === document) {\n return { serializedDocument: true };\n }\n if (target.nodeType != null) {\n const serializedElement: any = {\n serializedElement: true,\n nodeName: target.nodeName,\n nodeValue: target.nodeValue,\n nodeType: target.nodeType,\n tagName: target.tagName,\n className: target.className,\n id: target.id,\n };\n return serializedElement;\n }\n return null;\n };\n\n (window as any).serializeStencilEvent = (orgEv: CustomEvent) => {\n const serializedEvent = {\n bubbles: orgEv.bubbles,\n cancelBubble: orgEv.cancelBubble,\n cancelable: orgEv.cancelable,\n composed: orgEv.composed,\n currentTarget: (window as any).stencilSerializeEventTarget(orgEv.currentTarget),\n defaultPrevented: orgEv.defaultPrevented,\n detail: orgEv.detail,\n eventPhase: orgEv.eventPhase,\n isTrusted: orgEv.isTrusted,\n returnValue: orgEv.returnValue,\n srcElement: (window as any).stencilSerializeEventTarget(orgEv.srcElement),\n target: (window as any).stencilSerializeEventTarget(orgEv.target),\n timeStamp: orgEv.timeStamp,\n type: orgEv.type,\n isSerializedEvent: true,\n };\n return serializedEvent;\n };\n\n elm.addEventListener(eventName as string, (ev: Event) => {\n (window as any).stencilOnEvent(id, (window as any).serializeStencilEvent(ev));\n });\n },\n [eventName, id],\n );\n};\n", "import type { Locator } from '@playwright/test';\n\nimport type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport type LocatorOptions = {\n hasText?: string | RegExp;\n has?: Locator;\n};\n\nexport interface E2ELocator extends Locator {\n /**\n * Creates a new EventSpy and listens on the element for an event.\n * The test will timeout if the event never fires.\n *\n * Usage:\n * const input = page.locator('ion-input');\n * const ionChange = await locator.spyOnEvent('ionChange');\n * ...\n * await ionChange.next();\n */\n spyOnEvent: (eventName: string) => Promise<EventSpy>;\n}\n\nexport const locator = (\n page: E2EPage,\n originalFn: typeof page.locator,\n selector: string,\n options?: LocatorOptions,\n): E2ELocator => {\n const locator = originalFn(selector, options) as E2ELocator;\n locator.spyOnEvent = async (eventName: string) => {\n const spy = new EventSpy(eventName);\n const handle = await locator.evaluateHandle((node: HTMLElement) => node);\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n return spy;\n };\n return locator;\n};\n", "import type { Page, TestInfo } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * Overwrites the default Playwright page.setContent method.\n *\n * Navigates to a blank page, sets the content, and waits for the\n * Stencil components to be hydrated before proceeding with the test.\n *\n * @param page The Playwright page object.\n * @param html The HTML content to set on the page.\n * @param testInfo Test information from the test bed. Used to access base URL.\n * @param options The test config associated with the current test run.\n */\nexport const setContent = async (page: Page, html: string, testInfo: TestInfo, options?: E2EPageOptions) => {\n if (page.isClosed()) {\n throw new Error('setContent unavailable: page is already closed');\n }\n\n const baseUrl = testInfo.project.use.baseURL;\n const baseEntryPath = process.env.STENCIL_ENTRY_PATH;\n\n const output = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <title>Stencil Playwright Test</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\" />\n <script src=\"${baseEntryPath}.js\" nomodule></script>\n <script type=\"module\" src=\"${baseEntryPath}.esm.js\"></script>\n </head>\n <body>\n ${html}\n </body>\n </html>\n `;\n\n if (baseUrl) {\n await page.route(baseUrl, (route) => {\n if (route.request().url() === `${baseUrl}/`) {\n /**\n * Intercepts the empty page request and returns the\n * HTML content that was passed in.\n */\n route.fulfill({\n status: 200,\n contentType: 'text/html',\n body: output,\n });\n } else {\n // Allow all other requests to pass through\n route.continue();\n }\n });\n\n await page.goto(`${baseUrl}#`, options);\n } else {\n throw new Error('setContent unavailable: no dev server base URL provided');\n }\n};\n", "import type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport const spyOnEvent = async (page: E2EPage, eventName: string): Promise<EventSpy> => {\n const spy = new EventSpy(eventName);\n\n const handle = await page.evaluateHandle(() => window);\n\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n\n return spy;\n};\n", "import type { Page } from '@playwright/test';\nimport type { HostElement } from '@stencil/core/internal';\n\n/**\n * Waits for a combined threshold of a Stencil web component to be re-hydrated in the next repaint + 100ms.\n * Used for testing changes to a web component that does not modify CSS classes or introduce new DOM nodes.\n *\n * Original source: https://github.com/ionic-team/stencil/blob/main/src/testing/puppeteer/puppeteer-page.ts#L298-L363\n *\n * @param page The Playwright page object.\n * @param timeoutMs The time to wait for the changes to occur.\n */\nexport const waitForChanges = async (page: Page, timeoutMs = 100) => {\n try {\n if (page.isClosed()) {\n /**\n * If the page is already closed, we can skip the long execution of this method\n * and return early.\n */\n return;\n }\n await page.evaluate(() => {\n // BROWSER CONTEXT\n return new Promise<void>((resolve) => {\n // Wait for the next repaint to happen\n requestAnimationFrame(() => {\n const promiseChain: Promise<any>[] = [];\n\n const waitComponentOnReady = (elm: Element | ShadowRoot, promises: Promise<any>[]) => {\n if ('shadowRoot' in elm && elm.shadowRoot instanceof ShadowRoot) {\n waitComponentOnReady(elm.shadowRoot, promises);\n }\n const children = elm.children;\n const len = children.length;\n for (let i = 0; i < len; i++) {\n const childElm = children[i];\n const childStencilElm = childElm as HostElement;\n if (childElm.tagName.includes('-') && typeof childStencilElm.componentOnReady === 'function') {\n /**\n * We are only using the lazy loaded bundle\n * here so we can safely use the\n * componentOnReady method.\n */\n promises.push(childStencilElm.componentOnReady());\n }\n waitComponentOnReady(childElm, promises);\n }\n };\n\n waitComponentOnReady(document.documentElement, promiseChain);\n\n Promise.all(promiseChain)\n .then(() => resolve())\n .catch(() => resolve());\n });\n });\n });\n if (page.isClosed()) {\n return;\n }\n await page.waitForTimeout(timeoutMs);\n } catch (e) {\n console.error(e);\n }\n};\n", "import type {\n PlaywrightTestArgs,\n PlaywrightTestOptions,\n PlaywrightWorkerArgs,\n PlaywrightWorkerOptions,\n} from '@playwright/test';\nimport { test as base } from '@playwright/test';\n\nimport { loadConfigMeta } from './load-config-meta.js';\nimport { initPageEvents } from './page/event-spy';\nimport type { LocatorOptions } from './page/utils';\nimport { goto as goToPage, locator, setContent, spyOnEvent, waitForChanges } from './page/utils';\nimport type { BrowserNameOrCallback, E2EPage, E2EPageOptions, E2ESkip } from './playwright-declarations';\nimport { ProcessConstants } from './process-constants.js';\n\ntype CustomTestArgs = PlaywrightTestArgs &\n PlaywrightTestOptions &\n PlaywrightWorkerArgs &\n PlaywrightWorkerOptions & {\n page: E2EPage;\n };\n\ntype CustomFixtures = {\n page: E2EPage;\n skip: E2ESkip;\n};\n\n/**\n * Extends the base `page` test figure within Playwright.\n * @param page The page to extend.\n * @returns The modified playwright page with extended functionality.\n */\nasync function extendPageFixture(page: E2EPage) {\n // Make sure the Stencil namespace and entry path are set on the process so we can use them in the `setContent` tests.\n // These wouldn't be set if the user didn't setup the Playwright config with the `createConfig()` helper.\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE] || !process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n const { stencilNamespace, stencilEntryPath } = await loadConfigMeta();\n\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE]) {\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n }\n if (!process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n }\n }\n\n const originalGoto = page.goto.bind(page);\n const originalLocator = page.locator.bind(page);\n\n await page.addInitScript(() => {\n window.addEventListener('appload', () => {\n (window as any).testAppLoaded = true;\n });\n });\n\n // Overridden Playwright methods\n page.goto = (url: string, options?: E2EPageOptions) => goToPage(page, url, originalGoto, options);\n page.setContent = (html: string, options?: E2EPageOptions) => setContent(page, html, test.info(), options);\n page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);\n\n // Custom adapter methods\n page.waitForChanges = (timeoutMs?: number) => waitForChanges(page, timeoutMs);\n page.spyOnEvent = (eventName: string) => spyOnEvent(page, eventName);\n\n // Custom event behavior\n await initPageEvents(page);\n\n return page;\n}\n\nexport const test = base.extend<CustomFixtures>({\n page: async ({ page }: CustomTestArgs, use: (r: E2EPage) => Promise<void>) => {\n page = await extendPageFixture(page);\n await use(page);\n },\n skip: {\n browser: (\n browserNameOrFunction: BrowserNameOrCallback,\n reason = `The functionality that is being tested is not applicable to this browser.`,\n ) => {\n const browserName = base.info().project.use.browserName!;\n\n if (typeof browserNameOrFunction === 'function') {\n base.skip(browserNameOrFunction(browserName), reason);\n } else {\n base.skip(browserName === browserNameOrFunction, reason);\n }\n },\n mode: (mode: string, reason = `The functionality that is being tested is not applicable to ${mode} mode`) => {\n base.skip(base.info().project.metadata.mode === mode, reason);\n },\n },\n});\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,uCAAAA,UAAAC,SAAA;AAAA;AAEA,QAAI,oBAAoB,SAASC,mBAAkB,OAAO;AACzD,aAA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S,+DAA+D,IAAI,YAAY;AAC3G,mBAAAA,KAAK,KAAK,aAAAA,KAAK,KAAK,EAAE,QAAQ,SAAS,SAAS,MAAM,MAAM;AAAA,IAC9D;AAAA,EACF;AACF,CAAC;",
6
- "names": ["exports", "module", "isMergeableObject", "exports", "module", "import_node_path", "process", "fsPromises", "path", "import_node_url", "toPath", "path", "toPath", "merge", "deepEqual", "import_test", "import_fast_deep_equal", "deepEqual", "import_test", "import_fast_deep_equal", "deepEqual", "eventName", "id", "locator", "import_test", "base"]
4
+ "sourcesContent": ["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "export * from './create-config';\nexport * from './matchers';\nexport type { EventSpy } from './page/event-spy';\nexport * from './page/utils';\nexport * from './playwright-declarations';\nexport * from './playwright-page';\nexport * from './test-expect';\n", "import { PlaywrightTestConfig } from '@playwright/test';\nimport merge from 'deepmerge';\n\nimport { loadConfigMeta } from './load-config-meta';\nimport { ProcessConstants } from './process-constants';\n\n// Recursively apply the `Partial` type to all nested object types in the provided generic type\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>;\n }\n : T;\n\n/**\n * Helper function to easily create a Playwright config for Stencil projects. This function will\n * automatically load the Stencil config meta to set default values for the Playwright config respecting the\n * Stencil dev server configuration, and set the Stencil namespace and entry path as environment variables for use\n * in the Playwright tests.\n *\n * @param overrides Values to override in the default config. Any Playwright config option can be overridden.\n * @returns A {@link PlaywrightTestConfig} object\n */\nexport const createConfig = async (\n overrides: DeepPartial<PlaywrightTestConfig> = {},\n): Promise<PlaywrightTestConfig> => {\n const { webServerUrl, baseURL, stencilEntryPath, stencilNamespace } = await loadConfigMeta();\n\n // Set the Stencil namespace and entry path as environment variables so we can use them when constructing\n // the HTML `head` content in the `setContent` function. This is just an easy way for us to maintain some context\n // about the current Stencil project's configuration.\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n\n return merge<DeepPartial<PlaywrightTestConfig>>(\n {\n testMatch: '*.e2e.ts',\n use: {\n baseURL,\n },\n webServer: {\n command: 'stencil build --dev --watch --serve --no-open',\n url: webServerUrl,\n reuseExistingServer: !!!process.env.CI,\n // Max time to wait for dev server to start before aborting, defaults to 60000 (60 seconds)\n timeout: undefined,\n // Pipe the dev server output to the console\n // Gives visibility to the developer if the dev server fails to start\n stdout: 'pipe',\n },\n },\n overrides,\n ) as PlaywrightTestConfig;\n};\n", "import { loadConfig } from '@stencil/core/compiler';\nimport { OutputTargetWww } from '@stencil/core/internal';\nimport { findUp } from 'find-up';\nimport { existsSync } from 'fs';\nimport { relative } from 'path';\n\nconst DEFAULT_NAMESPACE = 'app';\nconst DEFAULT_BASE_URL = 'http://localhost:3333';\nconst DEFAULT_WEB_SERVER_URL = `${DEFAULT_BASE_URL}/ping`;\n\nconst DEFAULT_STENCIL_ENTRY_PATH_PREFIX = './build';\nconst DEFAULT_STENCIL_ENTRY_PATH = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${DEFAULT_NAMESPACE}`;\n\n/**\n * For internal use only.\n *\n * Loads and validates the project's Stencil config.\n *\n * @returns The processed Stencil config metadata.\n */\nexport const loadConfigMeta = async () => {\n let baseURL = DEFAULT_BASE_URL;\n let webServerUrl = DEFAULT_WEB_SERVER_URL;\n let stencilNamespace = DEFAULT_NAMESPACE;\n let stencilEntryPath = DEFAULT_STENCIL_ENTRY_PATH;\n\n // Find the Stencil config file in either the current directory, or the nearest ancestor directory.\n // This allows for the Playwright config to exist in a different directory than the Stencil config.\n const stencilConfigPath = await findUp(['stencil.config.ts', 'stencil.config.js']);\n\n // Only load the Stencil config if the user has created one\n if (stencilConfigPath && existsSync(stencilConfigPath)) {\n const { devServer, fsNamespace, outputTargets } = (await loadConfig({ configPath: stencilConfigPath })).config;\n\n // Grab the WWW output target. If one doesn't exist, we'll throw a warning and roll\n // with the default value for the entry path.\n const wwwTarget = outputTargets.find((o): o is OutputTargetWww => o.type === 'www');\n if (wwwTarget) {\n // Get path from dev-server root to www\n let relativePath = relative(devServer.root!, wwwTarget.dir!);\n relativePath = relativePath === '' ? '.' : relativePath;\n if (!relativePath.startsWith('.')) {\n relativePath = `./${relativePath}`;\n }\n\n stencilEntryPath = `${relativePath}/build/${fsNamespace}`;\n } else {\n // Make a best guess at the entry path\n stencilEntryPath = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${fsNamespace}`;\n\n console.warn(\n `No \"www\" output target found in the Stencil config. Using default entry path: \"${stencilEntryPath}\". Tests using 'setContent' may fail to execute.`,\n );\n }\n\n baseURL = `${devServer.protocol}://${devServer.address}:${devServer.port}`;\n webServerUrl = `${baseURL}${devServer.pingRoute ?? ''}`;\n stencilNamespace = fsNamespace;\n } else {\n const msg = stencilConfigPath\n ? `Unable to find your project's Stencil configuration file, starting from '${stencilConfigPath}'. Falling back to defaults.`\n : `No Stencil config file was found matching the glob 'stencil.config.{ts,js}' in the current or parent directories. Falling back to defaults.`;\n\n console.warn(msg);\n }\n\n return {\n baseURL,\n webServerUrl,\n stencilNamespace,\n stencilEntryPath,\n };\n};\n", "import path from 'node:path';\nimport fs from 'node:fs';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nasync function findDownDepthFirst(directory, paths, maxDepth, locateOptions, currentDepth = 0) {\n\tconst found = await locatePath(paths, {cwd: directory, ...locateOptions});\n\tif (found) {\n\t\treturn path.resolve(directory, found);\n\t}\n\n\tif (currentDepth >= maxDepth) {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\tconst entries = await fs.promises.readdir(directory, {withFileTypes: true});\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await findDownDepthFirst(\n\t\t\t\t\tpath.join(directory, entry.name),\n\t\t\t\t\tpaths,\n\t\t\t\t\tmaxDepth,\n\t\t\t\t\tlocateOptions,\n\t\t\t\t\tcurrentDepth + 1,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch {}\n\n\treturn undefined;\n}\n\nfunction findDownDepthFirstSync(directory, paths, maxDepth, locateOptions, currentDepth = 0) {\n\tconst found = locatePathSync(paths, {cwd: directory, ...locateOptions});\n\tif (found) {\n\t\treturn path.resolve(directory, found);\n\t}\n\n\tif (currentDepth >= maxDepth) {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\tconst entries = fs.readdirSync(directory, {withFileTypes: true});\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tconst result = findDownDepthFirstSync(\n\t\t\t\t\tpath.join(directory, entry.name),\n\t\t\t\t\tpaths,\n\t\t\t\t\tmaxDepth,\n\t\t\t\t\tlocateOptions,\n\t\t\t\t\tcurrentDepth + 1,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch {}\n\n\treturn undefined;\n}\n\nfunction prepareFindDownOptions(name, options) {\n\tconst startDirectory = path.resolve(toPath(options.cwd) ?? '');\n\tconst maxDepth = Math.max(0, options.depth ?? 1);\n\tconst paths = [name].flat();\n\tconst {type = 'file', allowSymlinks = true, strategy = 'breadth'} = options;\n\tconst locateOptions = {type, allowSymlinks};\n\treturn {\n\t\tstartDirectory,\n\t\tmaxDepth,\n\t\tpaths,\n\t\tlocateOptions,\n\t\tstrategy,\n\t};\n}\n\nasync function findDownBreadthFirst(startDirectory, paths, maxDepth, locateOptions) {\n\tconst queue = [{directory: startDirectory, depth: 0}];\n\n\twhile (queue.length > 0) {\n\t\tconst {directory, depth} = queue.shift();\n\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst found = await locatePath(paths, {cwd: directory, ...locateOptions});\n\t\tif (found) {\n\t\t\treturn path.resolve(directory, found);\n\t\t}\n\n\t\tif (depth >= maxDepth) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\tconst entries = await fs.promises.readdir(directory, {withFileTypes: true});\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tqueue.push({directory: path.join(directory, entry.name), depth: depth + 1});\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {}\n\t}\n\n\treturn undefined;\n}\n\nfunction findDownBreadthFirstSync(startDirectory, paths, maxDepth, locateOptions) {\n\tconst queue = [{directory: startDirectory, depth: 0}];\n\n\twhile (queue.length > 0) {\n\t\tconst {directory, depth} = queue.shift();\n\n\t\tconst found = locatePathSync(paths, {cwd: directory, ...locateOptions});\n\t\tif (found) {\n\t\t\treturn path.resolve(directory, found);\n\t\t}\n\n\t\tif (depth >= maxDepth) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst entries = fs.readdirSync(directory, {withFileTypes: true});\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tqueue.push({directory: path.join(directory, entry.name), depth: depth + 1});\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {}\n\t}\n\n\treturn undefined;\n}\n\nexport async function findDown(name, options = {}) {\n\tconst {startDirectory, maxDepth, paths, locateOptions, strategy} = prepareFindDownOptions(name, options);\n\n\treturn strategy === 'depth'\n\t\t? findDownDepthFirst(startDirectory, paths, maxDepth, locateOptions)\n\t\t: findDownBreadthFirst(startDirectory, paths, maxDepth, locateOptions);\n}\n\nexport function findDownSync(name, options = {}) {\n\tconst {startDirectory, maxDepth, paths, locateOptions, strategy} = prepareFindDownOptions(name, options);\n\n\treturn strategy === 'depth'\n\t\t? findDownDepthFirstSync(startDirectory, paths, maxDepth, locateOptions)\n\t\t: findDownBreadthFirstSync(startDirectory, paths, maxDepth, locateOptions);\n}\n\n", "import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (type === 'both' || Object.hasOwn(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => type === 'both' ? (stat.isFile() || stat.isDirectory()) : stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n", "/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\t* drain() {\n\t\twhile (this.#head) {\n\t\t\tyield this.dequeue();\n\t\t}\n\t}\n}\n", "import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n", "import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import {promisify} from 'node:util';\nimport {execFile as execFileCallback, execFileSync as execFileSyncOriginal} from 'node:child_process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst execFileOriginal = promisify(execFileCallback);\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport function rootDirectory(pathInput) {\n\treturn path.parse(toPath(pathInput)).root;\n}\n\nexport function traversePathUp(startPath) {\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\tlet currentPath = path.resolve(toPath(startPath));\n\t\t\tlet previousPath;\n\n\t\t\twhile (previousPath !== currentPath) {\n\t\t\t\tyield currentPath;\n\t\t\t\tpreviousPath = currentPath;\n\t\t\t\tcurrentPath = path.resolve(currentPath, '..');\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\nexport async function execFile(file, arguments_, options = {}) {\n\treturn execFileOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\t...options,\n\t});\n}\n\nexport function execFileSync(file, arguments_ = [], options = {}) {\n\treturn execFileSyncOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\tencoding: 'utf8',\n\t\tstdio: 'pipe',\n\t\t...options,\n\t});\n}\n\nexport * from './default.js';\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveFirstReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.firstEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveNthReceivedEventDetail(eventSpy: EventSpy, index: number, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const event = eventSpy.events[index];\n\n if (event === null || event === undefined) {\n return {\n message: () => `event at index ${index} was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(event.detail, eventDetail);\n\n expect(event.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEvent(eventSpy: EventSpy) {\n if (eventSpy === undefined || eventSpy === null) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n const pass = eventSpy.events.length > 0;\n if (pass) {\n return {\n message: () => `expected to have called ${eventSpy.eventName} event`,\n pass: true,\n };\n }\n return {\n message: () => `expected to have not called ${eventSpy.eventName} event`,\n pass: false,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.lastEvent === null || eventSpy.lastEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.lastEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventTimes(eventSpy: EventSpy, count: number) {\n if (!eventSpy) {\n return {\n message: () => `toHaveReceivedEventTimes event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventTimes did not receive an event spy`,\n pass: false,\n };\n }\n\n const pass = eventSpy.length === count;\n\n return {\n message: () =>\n `expected event \"${eventSpy.eventName}\" to have been called ${count} times, but it was called ${eventSpy.events.length} times`,\n pass: pass,\n };\n}\n", "import { toHaveFirstReceivedEventDetail } from './to-have-first-received-event-detail';\nimport { toHaveNthReceivedEventDetail } from './to-have-nth-received-event-detail';\nimport { toHaveReceivedEvent } from './to-have-received-event';\nimport { toHaveReceivedEventDetail } from './to-have-received-event-detail';\nimport { toHaveReceivedEventTimes } from './to-have-received-event-times';\n\nexport const matchers = {\n toHaveReceivedEvent,\n toHaveReceivedEventDetail,\n toHaveReceivedEventTimes,\n toHaveFirstReceivedEventDetail,\n toHaveNthReceivedEventDetail,\n};\n", "/* eslint-disable jsdoc/require-param */\n/* eslint-disable jsdoc/require-returns */\nimport type { Page } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * This is an extended version of Playwright's `page.goto` method. In addition to performing\n * the normal `page.goto` work, this code also automatically waits for the Stencil components\n * to be hydrated before proceeding with the test.\n */\nexport const goto = async (page: Page, url: string, originalFn: typeof page.goto, options?: E2EPageOptions) => {\n const result = await Promise.all([\n page.waitForFunction(() => (window as any).testAppLoaded === true, {\n // This timeout was taken from the existing Playwright adapter in the Ionic Framework repository.\n // They tested this number and found it to be a reliable timeout for the Stencil components to be hydrated.\n timeout: 4750,\n }),\n originalFn(url, options),\n ]);\n\n return result[1];\n};\n", "import type { JSHandle } from '@playwright/test';\n\nimport type { E2EPage } from '../playwright-declarations';\n\n/**\n * The EventSpy class allows developers to listen for a particular event emission and\n * pass/fail the test based on whether or not the event was emitted.\n * Based off https://github.com/ionic-team/stencil/blob/16b8ea4dabb22024872a38bc58ba1dcf1c7cc25b/src/testing/puppeteer/puppeteer-events.ts#L64\n */\nexport class EventSpy {\n /**\n * Keeping track of a cursor ensures that no two spy.next() calls point to the same event.\n */\n private cursor = 0;\n private queuedHandler: (() => void)[] = [];\n public events: CustomEvent[] = [];\n\n constructor(public eventName: string) {}\n\n get length() {\n return this.events.length;\n }\n\n get firstEvent() {\n return this.events[0] ?? null;\n }\n\n get lastEvent() {\n return this.events[this.events.length - 1] ?? null;\n }\n\n public next() {\n const { cursor } = this;\n this.cursor++;\n\n const next = this.events[cursor];\n if (next !== undefined) {\n return Promise.resolve(next);\n } else {\n /**\n * If the event has not already been emitted, then add it to the queuedHandler.\n * When the event is emitted, the push method is called which results in the Promise below being resolved.\n */\n let resolve: () => void;\n const promise = new Promise<void>((r) => (resolve = r));\n // @ts-ignore\n this.queuedHandler.push(resolve);\n\n return promise.then(() => this.events[cursor]);\n }\n }\n\n public push(ev: CustomEvent) {\n this.events.push(ev);\n const next = this.queuedHandler.shift();\n if (next) {\n next();\n }\n }\n}\n\n/**\n * For internal use only.\n *\n * Initializes information required to spy on events.\n * The stencilOnEvent function is called in the context of the current page.\n * This lets us respond to an event listener created within the page itself.\n *\n * @param page The Playwright test page object.\n */\nexport const initPageEvents = async (page: E2EPage) => {\n page._e2eEventsIds = 0;\n page._e2eEvents = new Map();\n\n await page.exposeFunction('stencilOnEvent', (id: number, ev: any) => {\n const context = page._e2eEvents.get(id);\n if (context) {\n context.callback(ev);\n }\n });\n};\n\n/**\n * For internal use only.\n *\n * Adds a new event listener in the current page context to updates\n * the _e2eEvents map when an event is fired.\n *\n * @param page The Playwright test page object.\n * @param elmHandle A {@link JSHandle} representing the element to listen for events on.\n * @param eventName The event name to listen for.\n * @param callback The callback to execute when the event is fired.\n */\nexport const addE2EListener = async (\n page: E2EPage,\n elmHandle: JSHandle,\n eventName: string,\n callback: (ev: any) => void,\n) => {\n const id = page._e2eEventsIds++;\n page._e2eEvents.set(id, {\n eventName,\n callback,\n });\n\n await elmHandle.evaluate(\n (elm, [eventName, id]) => {\n (window as any).stencilSerializeEventTarget = (target: any) => {\n // BROWSER CONTEXT\n if (!target) {\n return null;\n }\n if (target === window) {\n return { serializedWindow: true };\n }\n if (target === document) {\n return { serializedDocument: true };\n }\n if (target.nodeType != null) {\n const serializedElement: any = {\n serializedElement: true,\n nodeName: target.nodeName,\n nodeValue: target.nodeValue,\n nodeType: target.nodeType,\n tagName: target.tagName,\n className: target.className,\n id: target.id,\n };\n return serializedElement;\n }\n return null;\n };\n\n (window as any).serializeStencilEvent = (orgEv: CustomEvent) => {\n const serializedEvent = {\n bubbles: orgEv.bubbles,\n cancelBubble: orgEv.cancelBubble,\n cancelable: orgEv.cancelable,\n composed: orgEv.composed,\n currentTarget: (window as any).stencilSerializeEventTarget(orgEv.currentTarget),\n defaultPrevented: orgEv.defaultPrevented,\n detail: orgEv.detail,\n eventPhase: orgEv.eventPhase,\n isTrusted: orgEv.isTrusted,\n returnValue: orgEv.returnValue,\n srcElement: (window as any).stencilSerializeEventTarget(orgEv.srcElement),\n target: (window as any).stencilSerializeEventTarget(orgEv.target),\n timeStamp: orgEv.timeStamp,\n type: orgEv.type,\n isSerializedEvent: true,\n };\n return serializedEvent;\n };\n\n elm.addEventListener(eventName as string, (ev: Event) => {\n (window as any).stencilOnEvent(id, (window as any).serializeStencilEvent(ev));\n });\n },\n [eventName, id],\n );\n};\n", "import type { Locator } from '@playwright/test';\n\nimport type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport type LocatorOptions = {\n hasText?: string | RegExp;\n has?: Locator;\n};\n\nexport interface E2ELocator extends Locator {\n /**\n * Creates a new EventSpy and listens on the element for an event.\n * The test will timeout if the event never fires.\n *\n * Usage:\n * const input = page.locator('ion-input');\n * const ionChange = await locator.spyOnEvent('ionChange');\n * ...\n * await ionChange.next();\n */\n spyOnEvent: (eventName: string) => Promise<EventSpy>;\n}\n\nexport const locator = (\n page: E2EPage,\n originalFn: typeof page.locator,\n selector: string,\n options?: LocatorOptions,\n): E2ELocator => {\n const locator = originalFn(selector, options) as E2ELocator;\n locator.spyOnEvent = async (eventName: string) => {\n const spy = new EventSpy(eventName);\n const handle = await locator.evaluateHandle((node: HTMLElement) => node);\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n return spy;\n };\n return locator;\n};\n", "import type { Page, TestInfo } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * Overwrites the default Playwright page.setContent method.\n *\n * Navigates to a blank page, sets the content, and waits for the\n * Stencil components to be hydrated before proceeding with the test.\n *\n * @param page The Playwright page object.\n * @param html The HTML content to set on the page.\n * @param testInfo Test information from the test bed. Used to access base URL.\n * @param options The test config associated with the current test run.\n */\nexport const setContent = async (page: Page, html: string, testInfo: TestInfo, options?: E2EPageOptions) => {\n if (page.isClosed()) {\n throw new Error('setContent unavailable: page is already closed');\n }\n\n const baseUrl = testInfo.project.use.baseURL;\n const baseEntryPath = process.env.STENCIL_ENTRY_PATH;\n\n const output = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <title>Stencil Playwright Test</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\" />\n <script src=\"${baseEntryPath}.js\" nomodule></script>\n <script type=\"module\" src=\"${baseEntryPath}.esm.js\"></script>\n </head>\n <body>\n ${html}\n </body>\n </html>\n `;\n\n if (baseUrl) {\n await page.route(baseUrl, (route) => {\n if (route.request().url() === `${baseUrl}/`) {\n /**\n * Intercepts the empty page request and returns the\n * HTML content that was passed in.\n */\n route.fulfill({\n status: 200,\n contentType: 'text/html',\n body: output,\n });\n } else {\n // Allow all other requests to pass through\n route.continue();\n }\n });\n\n await page.goto(`${baseUrl}#`, options);\n } else {\n throw new Error('setContent unavailable: no dev server base URL provided');\n }\n};\n", "import type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport const spyOnEvent = async (page: E2EPage, eventName: string): Promise<EventSpy> => {\n const spy = new EventSpy(eventName);\n\n const handle = await page.evaluateHandle(() => window);\n\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n\n return spy;\n};\n", "import type { Page } from '@playwright/test';\nimport type { HostElement } from '@stencil/core/internal';\n\n/**\n * Waits for a combined threshold of a Stencil web component to be re-hydrated in the next repaint + 100ms.\n * Used for testing changes to a web component that does not modify CSS classes or introduce new DOM nodes.\n *\n * Original source: https://github.com/ionic-team/stencil/blob/main/src/testing/puppeteer/puppeteer-page.ts#L298-L363\n *\n * @param page The Playwright page object.\n * @param timeoutMs The time to wait for the changes to occur.\n */\nexport const waitForChanges = async (page: Page, timeoutMs = 100) => {\n try {\n if (page.isClosed()) {\n /**\n * If the page is already closed, we can skip the long execution of this method\n * and return early.\n */\n return;\n }\n await page.evaluate(() => {\n // BROWSER CONTEXT\n return new Promise<void>((resolve) => {\n // Wait for the next repaint to happen\n requestAnimationFrame(() => {\n const promiseChain: Promise<any>[] = [];\n\n const waitComponentOnReady = (elm: Element | ShadowRoot, promises: Promise<any>[]) => {\n if ('shadowRoot' in elm && elm.shadowRoot instanceof ShadowRoot) {\n waitComponentOnReady(elm.shadowRoot, promises);\n }\n const children = elm.children;\n const len = children.length;\n for (let i = 0; i < len; i++) {\n const childElm = children[i];\n const childStencilElm = childElm as HostElement;\n if (childElm.tagName.includes('-') && typeof childStencilElm.componentOnReady === 'function') {\n /**\n * We are only using the lazy loaded bundle\n * here so we can safely use the\n * componentOnReady method.\n */\n promises.push(childStencilElm.componentOnReady());\n }\n waitComponentOnReady(childElm, promises);\n }\n };\n\n waitComponentOnReady(document.documentElement, promiseChain);\n\n Promise.all(promiseChain)\n .then(() => resolve())\n .catch(() => resolve());\n });\n });\n });\n if (page.isClosed()) {\n return;\n }\n await page.waitForTimeout(timeoutMs);\n } catch (e) {\n console.error(e);\n }\n};\n", "import type {\n PlaywrightTestArgs,\n PlaywrightTestOptions,\n PlaywrightWorkerArgs,\n PlaywrightWorkerOptions,\n} from '@playwright/test';\nimport { test as base } from '@playwright/test';\n\nimport { loadConfigMeta } from './load-config-meta.js';\nimport { initPageEvents } from './page/event-spy';\nimport type { LocatorOptions } from './page/utils';\nimport { goto as goToPage, locator, setContent, spyOnEvent, waitForChanges } from './page/utils';\nimport type { BrowserNameOrCallback, E2EPage, E2EPageOptions, E2ESkip } from './playwright-declarations';\nimport { ProcessConstants } from './process-constants.js';\n\ntype CustomTestArgs = PlaywrightTestArgs &\n PlaywrightTestOptions &\n PlaywrightWorkerArgs &\n PlaywrightWorkerOptions & {\n page: E2EPage;\n };\n\ntype CustomFixtures = {\n page: E2EPage;\n skip: E2ESkip;\n};\n\n/**\n * Extends the base `page` test figure within Playwright.\n * @param page The page to extend.\n * @returns The modified playwright page with extended functionality.\n */\nasync function extendPageFixture(page: E2EPage) {\n // Make sure the Stencil namespace and entry path are set on the process so we can use them in the `setContent` tests.\n // These wouldn't be set if the user didn't setup the Playwright config with the `createConfig()` helper.\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE] || !process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n const { stencilNamespace, stencilEntryPath } = await loadConfigMeta();\n\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE]) {\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n }\n if (!process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n }\n }\n\n const originalGoto = page.goto.bind(page);\n const originalLocator = page.locator.bind(page);\n\n await page.addInitScript(() => {\n window.addEventListener('appload', () => {\n (window as any).testAppLoaded = true;\n });\n });\n\n // Overridden Playwright methods\n page.goto = (url: string, options?: E2EPageOptions) => goToPage(page, url, originalGoto, options);\n page.setContent = (html: string, options?: E2EPageOptions) => setContent(page, html, test.info(), options);\n page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);\n\n // Custom adapter methods\n page.waitForChanges = (timeoutMs?: number) => waitForChanges(page, timeoutMs);\n page.spyOnEvent = (eventName: string) => spyOnEvent(page, eventName);\n\n // Custom event behavior\n await initPageEvents(page);\n\n return page;\n}\n\nexport const test = base.extend<CustomFixtures>({\n page: async ({ page }: CustomTestArgs, use: (r: E2EPage) => Promise<void>) => {\n page = await extendPageFixture(page);\n await use(page);\n },\n skip: {\n browser: (\n browserNameOrFunction: BrowserNameOrCallback,\n reason = `The functionality that is being tested is not applicable to this browser.`,\n ) => {\n const browserName = base.info().project.use.browserName!;\n\n if (typeof browserNameOrFunction === 'function') {\n base.skip(browserNameOrFunction(browserName), reason);\n } else {\n base.skip(browserName === browserNameOrFunction, reason);\n }\n },\n mode: (mode: string, reason = `The functionality that is being tested is not applicable to ${mode} mode`) => {\n base.skip(base.info().project.metadata.mode === mode, reason);\n },\n },\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,uCAAAA,UAAAC,SAAA;AAAA;AAEA,QAAI,oBAAoB,SAASC,mBAAkB,OAAO;AACzD,aAAO,gBAAgB,KAAK,KACxB,CAAC,UAAU,KAAK;AAAA,IACrB;AAEA,aAAS,gBAAgB,OAAO;AAC/B,aAAO,CAAC,CAAC,SAAS,OAAO,UAAU;AAAA,IACpC;AAEA,aAAS,UAAU,OAAO;AACzB,UAAI,cAAc,OAAO,UAAU,SAAS,KAAK,KAAK;AAEtD,aAAO,gBAAgB,qBACnB,gBAAgB,mBAChB,eAAe,KAAK;AAAA,IACzB;AAGA,QAAI,eAAe,OAAO,WAAW,cAAc,OAAO;AAC1D,QAAI,qBAAqB,eAAe,OAAO,IAAI,eAAe,IAAI;AAEtE,aAAS,eAAe,OAAO;AAC9B,aAAO,MAAM,aAAa;AAAA,IAC3B;AAEA,aAAS,YAAY,KAAK;AACzB,aAAO,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;AAAA,IACnC;AAEA,aAAS,8BAA8B,OAAO,SAAS;AACtD,aAAQ,QAAQ,UAAU,SAAS,QAAQ,kBAAkB,KAAK,IAC/D,UAAU,YAAY,KAAK,GAAG,OAAO,OAAO,IAC5C;AAAA,IACJ;AAEA,aAAS,kBAAkB,QAAQ,QAAQ,SAAS;AACnD,aAAO,OAAO,OAAO,MAAM,EAAE,IAAI,SAAS,SAAS;AAClD,eAAO,8BAA8B,SAAS,OAAO;AAAA,MACtD,CAAC;AAAA,IACF;AA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AA6B,WAAW,MAAM,MAAM,KAAK,KAAK,GAAG,OAAO;AACzG,OAAK,UAAU,CAAC,UAAkB,YAA6B,QAAQ,MAAM,iBAAiB,UAAU,OAAO;AAG/G,OAAK,iBAAiB,CAAC,cAAuB,eAAe,MAAM,SAAS;AAC5E,OAAK,aAAa,CAAC,cAAsB,WAAW,MAAM,SAAS;AAGnE,QAAM,eAAe,IAAI;AAEzB,SAAO;AACT;AAEO,IAAM,OAAO,aAAAC,KAAK,OAAuB;AAAA,EAC9C,MAAM,OAAO,EAAE,KAAK,GAAmB,QAAuC;AAC5E,WAAO,MAAM,kBAAkB,IAAI;AACnC,UAAM,IAAI,IAAI;AAAA,EAChB;AAAA,EACA,MAAM;AAAA,IACJ,SAAS,CACP,uBACA,SAAS,gFACN;AACH,YAAM,cAAc,aAAAA,KAAK,KAAK,EAAE,QAAQ,IAAI;AAE5C,UAAI,OAAO,0BAA0B,YAAY;AAC/C,qBAAAA,KAAK,KAAK,sBAAsB,WAAW,GAAG,MAAM;AAAA,MACtD,OAAO;AACL,qBAAAA,KAAK,KAAK,gBAAgB,uBAAuB,MAAM;AAAA,MACzD;AAAA,IACF;AAAA,IACA,MAAM,CAAC,MAAc,SAAS,+DAA+D,IAAI,YAAY;AAC3G,mBAAAA,KAAK,KAAK,aAAAA,KAAK,KAAK,EAAE,QAAQ,SAAS,SAAS,MAAM,MAAM;AAAA,IAC9D;AAAA,EACF;AACF,CAAC;",
6
+ "names": ["exports", "module", "isMergeableObject", "exports", "module", "import_node_path", "process", "fsPromises", "path", "import_node_url", "execFileCallback", "toPath", "path", "toPath", "merge", "deepEqual", "import_test", "import_fast_deep_equal", "deepEqual", "import_test", "import_fast_deep_equal", "deepEqual", "eventName", "id", "locator", "import_test", "base"]
7
7
  }
package/dist/index.js CHANGED
@@ -132,38 +132,28 @@ var require_fast_deep_equal = __commonJS({
132
132
  "node_modules/fast-deep-equal/index.js"(exports, module) {
133
133
  "use strict";
134
134
  module.exports = function equal(a, b) {
135
- if (a === b)
136
- return true;
135
+ if (a === b) return true;
137
136
  if (a && b && typeof a == "object" && typeof b == "object") {
138
- if (a.constructor !== b.constructor)
139
- return false;
137
+ if (a.constructor !== b.constructor) return false;
140
138
  var length, i, keys;
141
139
  if (Array.isArray(a)) {
142
140
  length = a.length;
143
- if (length != b.length)
144
- return false;
141
+ if (length != b.length) return false;
145
142
  for (i = length; i-- !== 0; )
146
- if (!equal(a[i], b[i]))
147
- return false;
143
+ if (!equal(a[i], b[i])) return false;
148
144
  return true;
149
145
  }
150
- if (a.constructor === RegExp)
151
- return a.source === b.source && a.flags === b.flags;
152
- if (a.valueOf !== Object.prototype.valueOf)
153
- return a.valueOf() === b.valueOf();
154
- if (a.toString !== Object.prototype.toString)
155
- return a.toString() === b.toString();
146
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
147
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
148
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
156
149
  keys = Object.keys(a);
157
150
  length = keys.length;
158
- if (length !== Object.keys(b).length)
159
- return false;
151
+ if (length !== Object.keys(b).length) return false;
160
152
  for (i = length; i-- !== 0; )
161
- if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
162
- return false;
153
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
163
154
  for (i = length; i-- !== 0; ) {
164
155
  var key = keys[i];
165
- if (!equal(a[key], b[key]))
166
- return false;
156
+ if (!equal(a[key], b[key])) return false;
167
157
  }
168
158
  return true;
169
159
  }
@@ -222,6 +212,12 @@ var Queue = class {
222
212
  this.#size--;
223
213
  return current.value;
224
214
  }
215
+ peek() {
216
+ if (!this.#head) {
217
+ return;
218
+ }
219
+ return this.#head.value;
220
+ }
225
221
  clear() {
226
222
  this.#head = void 0;
227
223
  this.#tail = void 0;
@@ -237,6 +233,11 @@ var Queue = class {
237
233
  current = current.next;
238
234
  }
239
235
  }
236
+ *drain() {
237
+ while (this.#head) {
238
+ yield this.dequeue();
239
+ }
240
+ }
240
241
  };
241
242
 
242
243
  // node_modules/p-locate/node_modules/p-limit/index.js
@@ -328,12 +329,12 @@ var typeMappings = {
328
329
  file: "isFile"
329
330
  };
330
331
  function checkType(type) {
331
- if (Object.hasOwnProperty.call(typeMappings, type)) {
332
+ if (type === "both" || Object.hasOwn(typeMappings, type)) {
332
333
  return;
333
334
  }
334
335
  throw new Error(`Invalid type specified: ${type}`);
335
336
  }
336
- var matchType = (type, stat) => stat[typeMappings[type]]();
337
+ var matchType = (type, stat) => type === "both" ? stat.isFile() || stat.isDirectory() : stat[typeMappings[type]]();
337
338
  var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
338
339
  async function locatePath(paths, {
339
340
  cwd = process2.cwd(),
@@ -356,17 +357,21 @@ async function locatePath(paths, {
356
357
  }
357
358
 
358
359
  // node_modules/unicorn-magic/node.js
360
+ import { promisify } from "node:util";
361
+ import { execFile as execFileCallback, execFileSync as execFileSyncOriginal } from "node:child_process";
359
362
  import { fileURLToPath as fileURLToPath2 } from "node:url";
363
+ var execFileOriginal = promisify(execFileCallback);
360
364
  function toPath2(urlOrPath) {
361
365
  return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
362
366
  }
367
+ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
363
368
 
364
369
  // node_modules/find-up/index.js
365
370
  var findUpStop = Symbol("findUpStop");
366
371
  async function findUpMultiple(name, options = {}) {
367
372
  let directory = path2.resolve(toPath2(options.cwd) ?? "");
368
373
  const { root } = path2.parse(directory);
369
- const stopAt = path2.resolve(directory, toPath2(options.stopAt ?? root));
374
+ const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
370
375
  const limit = options.limit ?? Number.POSITIVE_INFINITY;
371
376
  const paths = [name].flat();
372
377
  const runMatcher = async (locateOptions) => {
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/deepmerge/dist/cjs.js", "../node_modules/fast-deep-equal/index.js", "../src/create-config.ts", "../src/load-config-meta.ts", "../node_modules/find-up/index.js", "../node_modules/locate-path/index.js", "../node_modules/p-locate/node_modules/yocto-queue/index.js", "../node_modules/p-locate/node_modules/p-limit/index.js", "../node_modules/p-locate/index.js", "../node_modules/unicorn-magic/node.js", "../src/matchers/to-have-first-received-event-detail.ts", "../src/matchers/to-have-nth-received-event-detail.ts", "../src/matchers/to-have-received-event.ts", "../src/matchers/to-have-received-event-detail.ts", "../src/matchers/to-have-received-event-times.ts", "../src/matchers/index.ts", "../src/page/utils/goto.ts", "../src/page/event-spy.ts", "../src/page/utils/locator.ts", "../src/page/utils/set-content.ts", "../src/page/utils/spy-on-event.ts", "../src/page/utils/wait-for-changes.ts", "../src/playwright-page.ts"],
4
- "sourcesContent": ["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "import { PlaywrightTestConfig } from '@playwright/test';\nimport merge from 'deepmerge';\n\nimport { loadConfigMeta } from './load-config-meta';\nimport { ProcessConstants } from './process-constants';\n\n// Recursively apply the `Partial` type to all nested object types in the provided generic type\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>;\n }\n : T;\n\n/**\n * Helper function to easily create a Playwright config for Stencil projects. This function will\n * automatically load the Stencil config meta to set default values for the Playwright config respecting the\n * Stencil dev server configuration, and set the Stencil namespace and entry path as environment variables for use\n * in the Playwright tests.\n *\n * @param overrides Values to override in the default config. Any Playwright config option can be overridden.\n * @returns A {@link PlaywrightTestConfig} object\n */\nexport const createConfig = async (\n overrides: DeepPartial<PlaywrightTestConfig> = {},\n): Promise<PlaywrightTestConfig> => {\n const { webServerUrl, baseURL, stencilEntryPath, stencilNamespace } = await loadConfigMeta();\n\n // Set the Stencil namespace and entry path as environment variables so we can use them when constructing\n // the HTML `head` content in the `setContent` function. This is just an easy way for us to maintain some context\n // about the current Stencil project's configuration.\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n\n return merge<DeepPartial<PlaywrightTestConfig>>(\n {\n testMatch: '*.e2e.ts',\n use: {\n baseURL,\n },\n webServer: {\n command: 'stencil build --dev --watch --serve --no-open',\n url: webServerUrl,\n reuseExistingServer: !!!process.env.CI,\n // Max time to wait for dev server to start before aborting, defaults to 60000 (60 seconds)\n timeout: undefined,\n // Pipe the dev server output to the console\n // Gives visibility to the developer if the dev server fails to start\n stdout: 'pipe',\n },\n },\n overrides,\n ) as PlaywrightTestConfig;\n};\n", "import { loadConfig } from '@stencil/core/compiler';\nimport { OutputTargetWww } from '@stencil/core/internal';\nimport { findUp } from 'find-up';\nimport { existsSync } from 'fs';\nimport { relative } from 'path';\n\nconst DEFAULT_NAMESPACE = 'app';\nconst DEFAULT_BASE_URL = 'http://localhost:3333';\nconst DEFAULT_WEB_SERVER_URL = `${DEFAULT_BASE_URL}/ping`;\n\nconst DEFAULT_STENCIL_ENTRY_PATH_PREFIX = './build';\nconst DEFAULT_STENCIL_ENTRY_PATH = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${DEFAULT_NAMESPACE}`;\n\n/**\n * For internal use only.\n *\n * Loads and validates the project's Stencil config.\n *\n * @returns The processed Stencil config metadata.\n */\nexport const loadConfigMeta = async () => {\n let baseURL = DEFAULT_BASE_URL;\n let webServerUrl = DEFAULT_WEB_SERVER_URL;\n let stencilNamespace = DEFAULT_NAMESPACE;\n let stencilEntryPath = DEFAULT_STENCIL_ENTRY_PATH;\n\n // Find the Stencil config file in either the current directory, or the nearest ancestor directory.\n // This allows for the Playwright config to exist in a different directory than the Stencil config.\n const stencilConfigPath = await findUp(['stencil.config.ts', 'stencil.config.js']);\n\n // Only load the Stencil config if the user has created one\n if (stencilConfigPath && existsSync(stencilConfigPath)) {\n const { devServer, fsNamespace, outputTargets } = (await loadConfig({ configPath: stencilConfigPath })).config;\n\n // Grab the WWW output target. If one doesn't exist, we'll throw a warning and roll\n // with the default value for the entry path.\n const wwwTarget = outputTargets.find((o): o is OutputTargetWww => o.type === 'www');\n if (wwwTarget) {\n // Get path from dev-server root to www\n let relativePath = relative(devServer.root!, wwwTarget.dir!);\n relativePath = relativePath === '' ? '.' : relativePath;\n if (!relativePath.startsWith('.')) {\n relativePath = `./${relativePath}`;\n }\n\n stencilEntryPath = `${relativePath}/build/${fsNamespace}`;\n } else {\n // Make a best guess at the entry path\n stencilEntryPath = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${fsNamespace}`;\n\n console.warn(\n `No \"www\" output target found in the Stencil config. Using default entry path: \"${stencilEntryPath}\". Tests using 'setContent' may fail to execute.`,\n );\n }\n\n baseURL = `${devServer.protocol}://${devServer.address}:${devServer.port}`;\n webServerUrl = `${baseURL}${devServer.pingRoute ?? ''}`;\n stencilNamespace = fsNamespace;\n } else {\n const msg = stencilConfigPath\n ? `Unable to find your project's Stencil configuration file, starting from '${stencilConfigPath}'. Falling back to defaults.`\n : `No Stencil config file was found matching the glob 'stencil.config.{ts,js}' in the current or parent directories. Falling back to defaults.`;\n\n console.warn(msg);\n }\n\n return {\n baseURL,\n webServerUrl,\n stencilNamespace,\n stencilEntryPath,\n };\n};\n", "import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n", "import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n", "/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n}\n", "import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n", "import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveFirstReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.firstEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveNthReceivedEventDetail(eventSpy: EventSpy, index: number, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const event = eventSpy.events[index];\n\n if (event === null || event === undefined) {\n return {\n message: () => `event at index ${index} was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(event.detail, eventDetail);\n\n expect(event.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEvent(eventSpy: EventSpy) {\n if (eventSpy === undefined || eventSpy === null) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n const pass = eventSpy.events.length > 0;\n if (pass) {\n return {\n message: () => `expected to have called ${eventSpy.eventName} event`,\n pass: true,\n };\n }\n return {\n message: () => `expected to have not called ${eventSpy.eventName} event`,\n pass: false,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.lastEvent === null || eventSpy.lastEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.lastEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventTimes(eventSpy: EventSpy, count: number) {\n if (!eventSpy) {\n return {\n message: () => `toHaveReceivedEventTimes event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventTimes did not receive an event spy`,\n pass: false,\n };\n }\n\n const pass = eventSpy.length === count;\n\n return {\n message: () =>\n `expected event \"${eventSpy.eventName}\" to have been called ${count} times, but it was called ${eventSpy.events.length} times`,\n pass: pass,\n };\n}\n", "import { toHaveFirstReceivedEventDetail } from './to-have-first-received-event-detail';\nimport { toHaveNthReceivedEventDetail } from './to-have-nth-received-event-detail';\nimport { toHaveReceivedEvent } from './to-have-received-event';\nimport { toHaveReceivedEventDetail } from './to-have-received-event-detail';\nimport { toHaveReceivedEventTimes } from './to-have-received-event-times';\n\nexport const matchers = {\n toHaveReceivedEvent,\n toHaveReceivedEventDetail,\n toHaveReceivedEventTimes,\n toHaveFirstReceivedEventDetail,\n toHaveNthReceivedEventDetail,\n};\n", "/* eslint-disable jsdoc/require-param */\n/* eslint-disable jsdoc/require-returns */\nimport type { Page } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * This is an extended version of Playwright's `page.goto` method. In addition to performing\n * the normal `page.goto` work, this code also automatically waits for the Stencil components\n * to be hydrated before proceeding with the test.\n */\nexport const goto = async (page: Page, url: string, originalFn: typeof page.goto, options?: E2EPageOptions) => {\n const result = await Promise.all([\n page.waitForFunction(() => (window as any).testAppLoaded === true, {\n // This timeout was taken from the existing Playwright adapter in the Ionic Framework repository.\n // They tested this number and found it to be a reliable timeout for the Stencil components to be hydrated.\n timeout: 4750,\n }),\n originalFn(url, options),\n ]);\n\n return result[1];\n};\n", "import type { JSHandle } from '@playwright/test';\n\nimport type { E2EPage } from '../playwright-declarations';\n\n/**\n * The EventSpy class allows developers to listen for a particular event emission and\n * pass/fail the test based on whether or not the event was emitted.\n * Based off https://github.com/ionic-team/stencil/blob/16b8ea4dabb22024872a38bc58ba1dcf1c7cc25b/src/testing/puppeteer/puppeteer-events.ts#L64\n */\nexport class EventSpy {\n /**\n * Keeping track of a cursor ensures that no two spy.next() calls point to the same event.\n */\n private cursor = 0;\n private queuedHandler: (() => void)[] = [];\n public events: CustomEvent[] = [];\n\n constructor(public eventName: string) {}\n\n get length() {\n return this.events.length;\n }\n\n get firstEvent() {\n return this.events[0] ?? null;\n }\n\n get lastEvent() {\n return this.events[this.events.length - 1] ?? null;\n }\n\n public next() {\n const { cursor } = this;\n this.cursor++;\n\n const next = this.events[cursor];\n if (next !== undefined) {\n return Promise.resolve(next);\n } else {\n /**\n * If the event has not already been emitted, then add it to the queuedHandler.\n * When the event is emitted, the push method is called which results in the Promise below being resolved.\n */\n let resolve: () => void;\n const promise = new Promise<void>((r) => (resolve = r));\n // @ts-ignore\n this.queuedHandler.push(resolve);\n\n return promise.then(() => this.events[cursor]);\n }\n }\n\n public push(ev: CustomEvent) {\n this.events.push(ev);\n const next = this.queuedHandler.shift();\n if (next) {\n next();\n }\n }\n}\n\n/**\n * For internal use only.\n *\n * Initializes information required to spy on events.\n * The stencilOnEvent function is called in the context of the current page.\n * This lets us respond to an event listener created within the page itself.\n *\n * @param page The Playwright test page object.\n */\nexport const initPageEvents = async (page: E2EPage) => {\n page._e2eEventsIds = 0;\n page._e2eEvents = new Map();\n\n await page.exposeFunction('stencilOnEvent', (id: number, ev: any) => {\n const context = page._e2eEvents.get(id);\n if (context) {\n context.callback(ev);\n }\n });\n};\n\n/**\n * For internal use only.\n *\n * Adds a new event listener in the current page context to updates\n * the _e2eEvents map when an event is fired.\n *\n * @param page The Playwright test page object.\n * @param elmHandle A {@link JSHandle} representing the element to listen for events on.\n * @param eventName The event name to listen for.\n * @param callback The callback to execute when the event is fired.\n */\nexport const addE2EListener = async (\n page: E2EPage,\n elmHandle: JSHandle,\n eventName: string,\n callback: (ev: any) => void,\n) => {\n const id = page._e2eEventsIds++;\n page._e2eEvents.set(id, {\n eventName,\n callback,\n });\n\n await elmHandle.evaluate(\n (elm, [eventName, id]) => {\n (window as any).stencilSerializeEventTarget = (target: any) => {\n // BROWSER CONTEXT\n if (!target) {\n return null;\n }\n if (target === window) {\n return { serializedWindow: true };\n }\n if (target === document) {\n return { serializedDocument: true };\n }\n if (target.nodeType != null) {\n const serializedElement: any = {\n serializedElement: true,\n nodeName: target.nodeName,\n nodeValue: target.nodeValue,\n nodeType: target.nodeType,\n tagName: target.tagName,\n className: target.className,\n id: target.id,\n };\n return serializedElement;\n }\n return null;\n };\n\n (window as any).serializeStencilEvent = (orgEv: CustomEvent) => {\n const serializedEvent = {\n bubbles: orgEv.bubbles,\n cancelBubble: orgEv.cancelBubble,\n cancelable: orgEv.cancelable,\n composed: orgEv.composed,\n currentTarget: (window as any).stencilSerializeEventTarget(orgEv.currentTarget),\n defaultPrevented: orgEv.defaultPrevented,\n detail: orgEv.detail,\n eventPhase: orgEv.eventPhase,\n isTrusted: orgEv.isTrusted,\n returnValue: orgEv.returnValue,\n srcElement: (window as any).stencilSerializeEventTarget(orgEv.srcElement),\n target: (window as any).stencilSerializeEventTarget(orgEv.target),\n timeStamp: orgEv.timeStamp,\n type: orgEv.type,\n isSerializedEvent: true,\n };\n return serializedEvent;\n };\n\n elm.addEventListener(eventName as string, (ev: Event) => {\n (window as any).stencilOnEvent(id, (window as any).serializeStencilEvent(ev));\n });\n },\n [eventName, id],\n );\n};\n", "import type { Locator } from '@playwright/test';\n\nimport type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport type LocatorOptions = {\n hasText?: string | RegExp;\n has?: Locator;\n};\n\nexport interface E2ELocator extends Locator {\n /**\n * Creates a new EventSpy and listens on the element for an event.\n * The test will timeout if the event never fires.\n *\n * Usage:\n * const input = page.locator('ion-input');\n * const ionChange = await locator.spyOnEvent('ionChange');\n * ...\n * await ionChange.next();\n */\n spyOnEvent: (eventName: string) => Promise<EventSpy>;\n}\n\nexport const locator = (\n page: E2EPage,\n originalFn: typeof page.locator,\n selector: string,\n options?: LocatorOptions,\n): E2ELocator => {\n const locator = originalFn(selector, options) as E2ELocator;\n locator.spyOnEvent = async (eventName: string) => {\n const spy = new EventSpy(eventName);\n const handle = await locator.evaluateHandle((node: HTMLElement) => node);\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n return spy;\n };\n return locator;\n};\n", "import type { Page, TestInfo } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * Overwrites the default Playwright page.setContent method.\n *\n * Navigates to a blank page, sets the content, and waits for the\n * Stencil components to be hydrated before proceeding with the test.\n *\n * @param page The Playwright page object.\n * @param html The HTML content to set on the page.\n * @param testInfo Test information from the test bed. Used to access base URL.\n * @param options The test config associated with the current test run.\n */\nexport const setContent = async (page: Page, html: string, testInfo: TestInfo, options?: E2EPageOptions) => {\n if (page.isClosed()) {\n throw new Error('setContent unavailable: page is already closed');\n }\n\n const baseUrl = testInfo.project.use.baseURL;\n const baseEntryPath = process.env.STENCIL_ENTRY_PATH;\n\n const output = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <title>Stencil Playwright Test</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\" />\n <script src=\"${baseEntryPath}.js\" nomodule></script>\n <script type=\"module\" src=\"${baseEntryPath}.esm.js\"></script>\n </head>\n <body>\n ${html}\n </body>\n </html>\n `;\n\n if (baseUrl) {\n await page.route(baseUrl, (route) => {\n if (route.request().url() === `${baseUrl}/`) {\n /**\n * Intercepts the empty page request and returns the\n * HTML content that was passed in.\n */\n route.fulfill({\n status: 200,\n contentType: 'text/html',\n body: output,\n });\n } else {\n // Allow all other requests to pass through\n route.continue();\n }\n });\n\n await page.goto(`${baseUrl}#`, options);\n } else {\n throw new Error('setContent unavailable: no dev server base URL provided');\n }\n};\n", "import type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport const spyOnEvent = async (page: E2EPage, eventName: string): Promise<EventSpy> => {\n const spy = new EventSpy(eventName);\n\n const handle = await page.evaluateHandle(() => window);\n\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n\n return spy;\n};\n", "import type { Page } from '@playwright/test';\nimport type { HostElement } from '@stencil/core/internal';\n\n/**\n * Waits for a combined threshold of a Stencil web component to be re-hydrated in the next repaint + 100ms.\n * Used for testing changes to a web component that does not modify CSS classes or introduce new DOM nodes.\n *\n * Original source: https://github.com/ionic-team/stencil/blob/main/src/testing/puppeteer/puppeteer-page.ts#L298-L363\n *\n * @param page The Playwright page object.\n * @param timeoutMs The time to wait for the changes to occur.\n */\nexport const waitForChanges = async (page: Page, timeoutMs = 100) => {\n try {\n if (page.isClosed()) {\n /**\n * If the page is already closed, we can skip the long execution of this method\n * and return early.\n */\n return;\n }\n await page.evaluate(() => {\n // BROWSER CONTEXT\n return new Promise<void>((resolve) => {\n // Wait for the next repaint to happen\n requestAnimationFrame(() => {\n const promiseChain: Promise<any>[] = [];\n\n const waitComponentOnReady = (elm: Element | ShadowRoot, promises: Promise<any>[]) => {\n if ('shadowRoot' in elm && elm.shadowRoot instanceof ShadowRoot) {\n waitComponentOnReady(elm.shadowRoot, promises);\n }\n const children = elm.children;\n const len = children.length;\n for (let i = 0; i < len; i++) {\n const childElm = children[i];\n const childStencilElm = childElm as HostElement;\n if (childElm.tagName.includes('-') && typeof childStencilElm.componentOnReady === 'function') {\n /**\n * We are only using the lazy loaded bundle\n * here so we can safely use the\n * componentOnReady method.\n */\n promises.push(childStencilElm.componentOnReady());\n }\n waitComponentOnReady(childElm, promises);\n }\n };\n\n waitComponentOnReady(document.documentElement, promiseChain);\n\n Promise.all(promiseChain)\n .then(() => resolve())\n .catch(() => resolve());\n });\n });\n });\n if (page.isClosed()) {\n return;\n }\n await page.waitForTimeout(timeoutMs);\n } catch (e) {\n console.error(e);\n }\n};\n", "import type {\n PlaywrightTestArgs,\n PlaywrightTestOptions,\n PlaywrightWorkerArgs,\n PlaywrightWorkerOptions,\n} from '@playwright/test';\nimport { test as base } from '@playwright/test';\n\nimport { loadConfigMeta } from './load-config-meta.js';\nimport { initPageEvents } from './page/event-spy';\nimport type { LocatorOptions } from './page/utils';\nimport { goto as goToPage, locator, setContent, spyOnEvent, waitForChanges } from './page/utils';\nimport type { BrowserNameOrCallback, E2EPage, E2EPageOptions, E2ESkip } from './playwright-declarations';\nimport { ProcessConstants } from './process-constants.js';\n\ntype CustomTestArgs = PlaywrightTestArgs &\n PlaywrightTestOptions &\n PlaywrightWorkerArgs &\n PlaywrightWorkerOptions & {\n page: E2EPage;\n };\n\ntype CustomFixtures = {\n page: E2EPage;\n skip: E2ESkip;\n};\n\n/**\n * Extends the base `page` test figure within Playwright.\n * @param page The page to extend.\n * @returns The modified playwright page with extended functionality.\n */\nasync function extendPageFixture(page: E2EPage) {\n // Make sure the Stencil namespace and entry path are set on the process so we can use them in the `setContent` tests.\n // These wouldn't be set if the user didn't setup the Playwright config with the `createConfig()` helper.\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE] || !process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n const { stencilNamespace, stencilEntryPath } = await loadConfigMeta();\n\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE]) {\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n }\n if (!process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n }\n }\n\n const originalGoto = page.goto.bind(page);\n const originalLocator = page.locator.bind(page);\n\n await page.addInitScript(() => {\n window.addEventListener('appload', () => {\n (window as any).testAppLoaded = true;\n });\n });\n\n // Overridden Playwright methods\n page.goto = (url: string, options?: E2EPageOptions) => goToPage(page, url, originalGoto, options);\n page.setContent = (html: string, options?: E2EPageOptions) => setContent(page, html, test.info(), options);\n page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);\n\n // Custom adapter methods\n page.waitForChanges = (timeoutMs?: number) => waitForChanges(page, timeoutMs);\n page.spyOnEvent = (eventName: string) => spyOnEvent(page, eventName);\n\n // Custom event behavior\n await initPageEvents(page);\n\n return page;\n}\n\nexport const test = base.extend<CustomFixtures>({\n page: async ({ page }: CustomTestArgs, use: (r: E2EPage) => Promise<void>) => {\n page = await extendPageFixture(page);\n await use(page);\n },\n skip: {\n browser: (\n browserNameOrFunction: BrowserNameOrCallback,\n reason = `The functionality that is being tested is not applicable to this browser.`,\n ) => {\n const browserName = base.info().project.use.browserName!;\n\n if (typeof browserNameOrFunction === 'function') {\n base.skip(browserNameOrFunction(browserName), reason);\n } else {\n base.skip(browserName === browserNameOrFunction, reason);\n }\n },\n mode: (mode: string, reason = `The functionality that is being tested is not applicable to ${mode} mode`) => {\n base.skip(base.info().project.metadata.mode === mode, reason);\n },\n },\n});\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAI,oBAAoB,SAASA,mBAAkB,OAAO;AACzD,aAAO,gBAAgB,KAAK,KACxB,CAAC,UAAU,KAAK;AAAA,IACrB;AAEA,aAAS,gBAAgB,OAAO;AAC/B,aAAO,CAAC,CAAC,SAAS,OAAO,UAAU;AAAA,IACpC;AAEA,aAAS,UAAU,OAAO;AACzB,UAAI,cAAc,OAAO,UAAU,SAAS,KAAK,KAAK;AAEtD,aAAO,gBAAgB,qBACnB,gBAAgB,mBAChB,eAAe,KAAK;AAAA,IACzB;AAGA,QAAI,eAAe,OAAO,WAAW,cAAc,OAAO;AAC1D,QAAI,qBAAqB,eAAe,OAAO,IAAI,eAAe,IAAI;AAEtE,aAAS,eAAe,OAAO;AAC9B,aAAO,MAAM,aAAa;AAAA,IAC3B;AAEA,aAAS,YAAY,KAAK;AACzB,aAAO,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;AAAA,IACnC;AAEA,aAAS,8BAA8B,OAAO,SAAS;AACtD,aAAQ,QAAQ,UAAU,SAAS,QAAQ,kBAAkB,KAAK,IAC/D,UAAU,YAAY,KAAK,GAAG,OAAO,OAAO,IAC5C;AAAA,IACJ;AAEA,aAAS,kBAAkB,QAAQ,QAAQ,SAAS;AACnD,aAAO,OAAO,OAAO,MAAM,EAAE,IAAI,SAAS,SAAS;AAClD,eAAO,8BAA8B,SAAS,OAAO;AAAA,MACtD,CAAC;AAAA,IACF;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IACJ,SAAS,CACP,uBACA,SAAS,gFACN;AACH,YAAM,cAAc,KAAK,KAAK,EAAE,QAAQ,IAAI;AAE5C,UAAI,OAAO,0BAA0B,YAAY;AAC/C,aAAK,KAAK,sBAAsB,WAAW,GAAG,MAAM;AAAA,MACtD,OAAO;AACL,aAAK,KAAK,gBAAgB,uBAAuB,MAAM;AAAA,MACzD;AAAA,IACF;AAAA,IACA,MAAM,CAAC,MAAc,SAAS,+DAA+D,IAAI,YAAY;AAC3G,WAAK,KAAK,KAAK,KAAK,EAAE,QAAQ,SAAS,SAAS,MAAM,MAAM;AAAA,IAC9D;AAAA,EACF;AACF,CAAC;",
4
+ "sourcesContent": ["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "import { PlaywrightTestConfig } from '@playwright/test';\nimport merge from 'deepmerge';\n\nimport { loadConfigMeta } from './load-config-meta';\nimport { ProcessConstants } from './process-constants';\n\n// Recursively apply the `Partial` type to all nested object types in the provided generic type\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>;\n }\n : T;\n\n/**\n * Helper function to easily create a Playwright config for Stencil projects. This function will\n * automatically load the Stencil config meta to set default values for the Playwright config respecting the\n * Stencil dev server configuration, and set the Stencil namespace and entry path as environment variables for use\n * in the Playwright tests.\n *\n * @param overrides Values to override in the default config. Any Playwright config option can be overridden.\n * @returns A {@link PlaywrightTestConfig} object\n */\nexport const createConfig = async (\n overrides: DeepPartial<PlaywrightTestConfig> = {},\n): Promise<PlaywrightTestConfig> => {\n const { webServerUrl, baseURL, stencilEntryPath, stencilNamespace } = await loadConfigMeta();\n\n // Set the Stencil namespace and entry path as environment variables so we can use them when constructing\n // the HTML `head` content in the `setContent` function. This is just an easy way for us to maintain some context\n // about the current Stencil project's configuration.\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n\n return merge<DeepPartial<PlaywrightTestConfig>>(\n {\n testMatch: '*.e2e.ts',\n use: {\n baseURL,\n },\n webServer: {\n command: 'stencil build --dev --watch --serve --no-open',\n url: webServerUrl,\n reuseExistingServer: !!!process.env.CI,\n // Max time to wait for dev server to start before aborting, defaults to 60000 (60 seconds)\n timeout: undefined,\n // Pipe the dev server output to the console\n // Gives visibility to the developer if the dev server fails to start\n stdout: 'pipe',\n },\n },\n overrides,\n ) as PlaywrightTestConfig;\n};\n", "import { loadConfig } from '@stencil/core/compiler';\nimport { OutputTargetWww } from '@stencil/core/internal';\nimport { findUp } from 'find-up';\nimport { existsSync } from 'fs';\nimport { relative } from 'path';\n\nconst DEFAULT_NAMESPACE = 'app';\nconst DEFAULT_BASE_URL = 'http://localhost:3333';\nconst DEFAULT_WEB_SERVER_URL = `${DEFAULT_BASE_URL}/ping`;\n\nconst DEFAULT_STENCIL_ENTRY_PATH_PREFIX = './build';\nconst DEFAULT_STENCIL_ENTRY_PATH = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${DEFAULT_NAMESPACE}`;\n\n/**\n * For internal use only.\n *\n * Loads and validates the project's Stencil config.\n *\n * @returns The processed Stencil config metadata.\n */\nexport const loadConfigMeta = async () => {\n let baseURL = DEFAULT_BASE_URL;\n let webServerUrl = DEFAULT_WEB_SERVER_URL;\n let stencilNamespace = DEFAULT_NAMESPACE;\n let stencilEntryPath = DEFAULT_STENCIL_ENTRY_PATH;\n\n // Find the Stencil config file in either the current directory, or the nearest ancestor directory.\n // This allows for the Playwright config to exist in a different directory than the Stencil config.\n const stencilConfigPath = await findUp(['stencil.config.ts', 'stencil.config.js']);\n\n // Only load the Stencil config if the user has created one\n if (stencilConfigPath && existsSync(stencilConfigPath)) {\n const { devServer, fsNamespace, outputTargets } = (await loadConfig({ configPath: stencilConfigPath })).config;\n\n // Grab the WWW output target. If one doesn't exist, we'll throw a warning and roll\n // with the default value for the entry path.\n const wwwTarget = outputTargets.find((o): o is OutputTargetWww => o.type === 'www');\n if (wwwTarget) {\n // Get path from dev-server root to www\n let relativePath = relative(devServer.root!, wwwTarget.dir!);\n relativePath = relativePath === '' ? '.' : relativePath;\n if (!relativePath.startsWith('.')) {\n relativePath = `./${relativePath}`;\n }\n\n stencilEntryPath = `${relativePath}/build/${fsNamespace}`;\n } else {\n // Make a best guess at the entry path\n stencilEntryPath = `${DEFAULT_STENCIL_ENTRY_PATH_PREFIX}/${fsNamespace}`;\n\n console.warn(\n `No \"www\" output target found in the Stencil config. Using default entry path: \"${stencilEntryPath}\". Tests using 'setContent' may fail to execute.`,\n );\n }\n\n baseURL = `${devServer.protocol}://${devServer.address}:${devServer.port}`;\n webServerUrl = `${baseURL}${devServer.pingRoute ?? ''}`;\n stencilNamespace = fsNamespace;\n } else {\n const msg = stencilConfigPath\n ? `Unable to find your project's Stencil configuration file, starting from '${stencilConfigPath}'. Falling back to defaults.`\n : `No Stencil config file was found matching the glob 'stencil.config.{ts,js}' in the current or parent directories. Falling back to defaults.`;\n\n console.warn(msg);\n }\n\n return {\n baseURL,\n webServerUrl,\n stencilNamespace,\n stencilEntryPath,\n };\n};\n", "import path from 'node:path';\nimport fs from 'node:fs';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nasync function findDownDepthFirst(directory, paths, maxDepth, locateOptions, currentDepth = 0) {\n\tconst found = await locatePath(paths, {cwd: directory, ...locateOptions});\n\tif (found) {\n\t\treturn path.resolve(directory, found);\n\t}\n\n\tif (currentDepth >= maxDepth) {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\tconst entries = await fs.promises.readdir(directory, {withFileTypes: true});\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await findDownDepthFirst(\n\t\t\t\t\tpath.join(directory, entry.name),\n\t\t\t\t\tpaths,\n\t\t\t\t\tmaxDepth,\n\t\t\t\t\tlocateOptions,\n\t\t\t\t\tcurrentDepth + 1,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch {}\n\n\treturn undefined;\n}\n\nfunction findDownDepthFirstSync(directory, paths, maxDepth, locateOptions, currentDepth = 0) {\n\tconst found = locatePathSync(paths, {cwd: directory, ...locateOptions});\n\tif (found) {\n\t\treturn path.resolve(directory, found);\n\t}\n\n\tif (currentDepth >= maxDepth) {\n\t\treturn undefined;\n\t}\n\n\ttry {\n\t\tconst entries = fs.readdirSync(directory, {withFileTypes: true});\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tconst result = findDownDepthFirstSync(\n\t\t\t\t\tpath.join(directory, entry.name),\n\t\t\t\t\tpaths,\n\t\t\t\t\tmaxDepth,\n\t\t\t\t\tlocateOptions,\n\t\t\t\t\tcurrentDepth + 1,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch {}\n\n\treturn undefined;\n}\n\nfunction prepareFindDownOptions(name, options) {\n\tconst startDirectory = path.resolve(toPath(options.cwd) ?? '');\n\tconst maxDepth = Math.max(0, options.depth ?? 1);\n\tconst paths = [name].flat();\n\tconst {type = 'file', allowSymlinks = true, strategy = 'breadth'} = options;\n\tconst locateOptions = {type, allowSymlinks};\n\treturn {\n\t\tstartDirectory,\n\t\tmaxDepth,\n\t\tpaths,\n\t\tlocateOptions,\n\t\tstrategy,\n\t};\n}\n\nasync function findDownBreadthFirst(startDirectory, paths, maxDepth, locateOptions) {\n\tconst queue = [{directory: startDirectory, depth: 0}];\n\n\twhile (queue.length > 0) {\n\t\tconst {directory, depth} = queue.shift();\n\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst found = await locatePath(paths, {cwd: directory, ...locateOptions});\n\t\tif (found) {\n\t\t\treturn path.resolve(directory, found);\n\t\t}\n\n\t\tif (depth >= maxDepth) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\tconst entries = await fs.promises.readdir(directory, {withFileTypes: true});\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tqueue.push({directory: path.join(directory, entry.name), depth: depth + 1});\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {}\n\t}\n\n\treturn undefined;\n}\n\nfunction findDownBreadthFirstSync(startDirectory, paths, maxDepth, locateOptions) {\n\tconst queue = [{directory: startDirectory, depth: 0}];\n\n\twhile (queue.length > 0) {\n\t\tconst {directory, depth} = queue.shift();\n\n\t\tconst found = locatePathSync(paths, {cwd: directory, ...locateOptions});\n\t\tif (found) {\n\t\t\treturn path.resolve(directory, found);\n\t\t}\n\n\t\tif (depth >= maxDepth) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst entries = fs.readdirSync(directory, {withFileTypes: true});\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\tqueue.push({directory: path.join(directory, entry.name), depth: depth + 1});\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {}\n\t}\n\n\treturn undefined;\n}\n\nexport async function findDown(name, options = {}) {\n\tconst {startDirectory, maxDepth, paths, locateOptions, strategy} = prepareFindDownOptions(name, options);\n\n\treturn strategy === 'depth'\n\t\t? findDownDepthFirst(startDirectory, paths, maxDepth, locateOptions)\n\t\t: findDownBreadthFirst(startDirectory, paths, maxDepth, locateOptions);\n}\n\nexport function findDownSync(name, options = {}) {\n\tconst {startDirectory, maxDepth, paths, locateOptions, strategy} = prepareFindDownOptions(name, options);\n\n\treturn strategy === 'depth'\n\t\t? findDownDepthFirstSync(startDirectory, paths, maxDepth, locateOptions)\n\t\t: findDownBreadthFirstSync(startDirectory, paths, maxDepth, locateOptions);\n}\n\n", "import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (type === 'both' || Object.hasOwn(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => type === 'both' ? (stat.isFile() || stat.isDirectory()) : stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n", "/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\t* drain() {\n\t\twhile (this.#head) {\n\t\t\tyield this.dequeue();\n\t\t}\n\t}\n}\n", "import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n", "import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n", "import {promisify} from 'node:util';\nimport {execFile as execFileCallback, execFileSync as execFileSyncOriginal} from 'node:child_process';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\n\nconst execFileOriginal = promisify(execFileCallback);\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport function rootDirectory(pathInput) {\n\treturn path.parse(toPath(pathInput)).root;\n}\n\nexport function traversePathUp(startPath) {\n\treturn {\n\t\t* [Symbol.iterator]() {\n\t\t\tlet currentPath = path.resolve(toPath(startPath));\n\t\t\tlet previousPath;\n\n\t\t\twhile (previousPath !== currentPath) {\n\t\t\t\tyield currentPath;\n\t\t\t\tpreviousPath = currentPath;\n\t\t\t\tcurrentPath = path.resolve(currentPath, '..');\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;\n\nexport async function execFile(file, arguments_, options = {}) {\n\treturn execFileOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\t...options,\n\t});\n}\n\nexport function execFileSync(file, arguments_ = [], options = {}) {\n\treturn execFileSyncOriginal(file, arguments_, {\n\t\tmaxBuffer: TEN_MEGABYTES_IN_BYTES,\n\t\tencoding: 'utf8',\n\t\tstdio: 'pipe',\n\t\t...options,\n\t});\n}\n\nexport * from './default.js';\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveFirstReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.firstEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport { EventSpy } from '../page/event-spy';\n\nexport function toHaveNthReceivedEventDetail(eventSpy: EventSpy, index: number, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (eventSpy.eventName === null || eventSpy.eventName === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.firstEvent === null || eventSpy.firstEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const event = eventSpy.events[index];\n\n if (event === null || event === undefined) {\n return {\n message: () => `event at index ${index} was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(event.detail, eventDetail);\n\n expect(event.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEvent(eventSpy: EventSpy) {\n if (eventSpy === undefined || eventSpy === null) {\n return {\n message: () => `expected spy to have received event, but it was not defined`,\n pass: false,\n };\n }\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n const pass = eventSpy.events.length > 0;\n if (pass) {\n return {\n message: () => `expected to have called ${eventSpy.eventName} event`,\n pass: true,\n };\n }\n return {\n message: () => `expected to have not called ${eventSpy.eventName} event`,\n pass: false,\n };\n}\n", "import { expect } from '@playwright/test';\nimport deepEqual from 'fast-deep-equal';\n\nimport type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventDetail(eventSpy: EventSpy, eventDetail: any) {\n if (eventSpy === null || eventSpy === undefined) {\n return {\n message: () => `toHaveReceivedEventDetail event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventDetail did not receive an event spy`,\n pass: false,\n };\n }\n\n if (eventSpy.lastEvent === null || eventSpy.lastEvent === undefined) {\n return {\n message: () => `event \"${eventSpy.eventName}\" was not received`,\n pass: false,\n };\n }\n\n const pass = deepEqual(eventSpy.lastEvent.detail, eventDetail);\n\n expect(eventSpy.lastEvent.detail).toEqual(eventDetail);\n\n return {\n message: () => `expected event \"${eventSpy.eventName}\" detail to ${pass ? 'not ' : ''}equal`,\n pass: pass,\n };\n}\n", "import type { EventSpy } from '../page/event-spy';\n\nexport function toHaveReceivedEventTimes(eventSpy: EventSpy, count: number) {\n if (!eventSpy) {\n return {\n message: () => `toHaveReceivedEventTimes event spy is null`,\n pass: false,\n };\n }\n\n if (typeof (eventSpy as any).then === 'function') {\n return {\n message: () =>\n `expected spy to have received event, but it was not resolved (did you forget an await operator?).`,\n pass: false,\n };\n }\n\n if (!eventSpy.eventName) {\n return {\n message: () => `toHaveReceivedEventTimes did not receive an event spy`,\n pass: false,\n };\n }\n\n const pass = eventSpy.length === count;\n\n return {\n message: () =>\n `expected event \"${eventSpy.eventName}\" to have been called ${count} times, but it was called ${eventSpy.events.length} times`,\n pass: pass,\n };\n}\n", "import { toHaveFirstReceivedEventDetail } from './to-have-first-received-event-detail';\nimport { toHaveNthReceivedEventDetail } from './to-have-nth-received-event-detail';\nimport { toHaveReceivedEvent } from './to-have-received-event';\nimport { toHaveReceivedEventDetail } from './to-have-received-event-detail';\nimport { toHaveReceivedEventTimes } from './to-have-received-event-times';\n\nexport const matchers = {\n toHaveReceivedEvent,\n toHaveReceivedEventDetail,\n toHaveReceivedEventTimes,\n toHaveFirstReceivedEventDetail,\n toHaveNthReceivedEventDetail,\n};\n", "/* eslint-disable jsdoc/require-param */\n/* eslint-disable jsdoc/require-returns */\nimport type { Page } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * This is an extended version of Playwright's `page.goto` method. In addition to performing\n * the normal `page.goto` work, this code also automatically waits for the Stencil components\n * to be hydrated before proceeding with the test.\n */\nexport const goto = async (page: Page, url: string, originalFn: typeof page.goto, options?: E2EPageOptions) => {\n const result = await Promise.all([\n page.waitForFunction(() => (window as any).testAppLoaded === true, {\n // This timeout was taken from the existing Playwright adapter in the Ionic Framework repository.\n // They tested this number and found it to be a reliable timeout for the Stencil components to be hydrated.\n timeout: 4750,\n }),\n originalFn(url, options),\n ]);\n\n return result[1];\n};\n", "import type { JSHandle } from '@playwright/test';\n\nimport type { E2EPage } from '../playwright-declarations';\n\n/**\n * The EventSpy class allows developers to listen for a particular event emission and\n * pass/fail the test based on whether or not the event was emitted.\n * Based off https://github.com/ionic-team/stencil/blob/16b8ea4dabb22024872a38bc58ba1dcf1c7cc25b/src/testing/puppeteer/puppeteer-events.ts#L64\n */\nexport class EventSpy {\n /**\n * Keeping track of a cursor ensures that no two spy.next() calls point to the same event.\n */\n private cursor = 0;\n private queuedHandler: (() => void)[] = [];\n public events: CustomEvent[] = [];\n\n constructor(public eventName: string) {}\n\n get length() {\n return this.events.length;\n }\n\n get firstEvent() {\n return this.events[0] ?? null;\n }\n\n get lastEvent() {\n return this.events[this.events.length - 1] ?? null;\n }\n\n public next() {\n const { cursor } = this;\n this.cursor++;\n\n const next = this.events[cursor];\n if (next !== undefined) {\n return Promise.resolve(next);\n } else {\n /**\n * If the event has not already been emitted, then add it to the queuedHandler.\n * When the event is emitted, the push method is called which results in the Promise below being resolved.\n */\n let resolve: () => void;\n const promise = new Promise<void>((r) => (resolve = r));\n // @ts-ignore\n this.queuedHandler.push(resolve);\n\n return promise.then(() => this.events[cursor]);\n }\n }\n\n public push(ev: CustomEvent) {\n this.events.push(ev);\n const next = this.queuedHandler.shift();\n if (next) {\n next();\n }\n }\n}\n\n/**\n * For internal use only.\n *\n * Initializes information required to spy on events.\n * The stencilOnEvent function is called in the context of the current page.\n * This lets us respond to an event listener created within the page itself.\n *\n * @param page The Playwright test page object.\n */\nexport const initPageEvents = async (page: E2EPage) => {\n page._e2eEventsIds = 0;\n page._e2eEvents = new Map();\n\n await page.exposeFunction('stencilOnEvent', (id: number, ev: any) => {\n const context = page._e2eEvents.get(id);\n if (context) {\n context.callback(ev);\n }\n });\n};\n\n/**\n * For internal use only.\n *\n * Adds a new event listener in the current page context to updates\n * the _e2eEvents map when an event is fired.\n *\n * @param page The Playwright test page object.\n * @param elmHandle A {@link JSHandle} representing the element to listen for events on.\n * @param eventName The event name to listen for.\n * @param callback The callback to execute when the event is fired.\n */\nexport const addE2EListener = async (\n page: E2EPage,\n elmHandle: JSHandle,\n eventName: string,\n callback: (ev: any) => void,\n) => {\n const id = page._e2eEventsIds++;\n page._e2eEvents.set(id, {\n eventName,\n callback,\n });\n\n await elmHandle.evaluate(\n (elm, [eventName, id]) => {\n (window as any).stencilSerializeEventTarget = (target: any) => {\n // BROWSER CONTEXT\n if (!target) {\n return null;\n }\n if (target === window) {\n return { serializedWindow: true };\n }\n if (target === document) {\n return { serializedDocument: true };\n }\n if (target.nodeType != null) {\n const serializedElement: any = {\n serializedElement: true,\n nodeName: target.nodeName,\n nodeValue: target.nodeValue,\n nodeType: target.nodeType,\n tagName: target.tagName,\n className: target.className,\n id: target.id,\n };\n return serializedElement;\n }\n return null;\n };\n\n (window as any).serializeStencilEvent = (orgEv: CustomEvent) => {\n const serializedEvent = {\n bubbles: orgEv.bubbles,\n cancelBubble: orgEv.cancelBubble,\n cancelable: orgEv.cancelable,\n composed: orgEv.composed,\n currentTarget: (window as any).stencilSerializeEventTarget(orgEv.currentTarget),\n defaultPrevented: orgEv.defaultPrevented,\n detail: orgEv.detail,\n eventPhase: orgEv.eventPhase,\n isTrusted: orgEv.isTrusted,\n returnValue: orgEv.returnValue,\n srcElement: (window as any).stencilSerializeEventTarget(orgEv.srcElement),\n target: (window as any).stencilSerializeEventTarget(orgEv.target),\n timeStamp: orgEv.timeStamp,\n type: orgEv.type,\n isSerializedEvent: true,\n };\n return serializedEvent;\n };\n\n elm.addEventListener(eventName as string, (ev: Event) => {\n (window as any).stencilOnEvent(id, (window as any).serializeStencilEvent(ev));\n });\n },\n [eventName, id],\n );\n};\n", "import type { Locator } from '@playwright/test';\n\nimport type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport type LocatorOptions = {\n hasText?: string | RegExp;\n has?: Locator;\n};\n\nexport interface E2ELocator extends Locator {\n /**\n * Creates a new EventSpy and listens on the element for an event.\n * The test will timeout if the event never fires.\n *\n * Usage:\n * const input = page.locator('ion-input');\n * const ionChange = await locator.spyOnEvent('ionChange');\n * ...\n * await ionChange.next();\n */\n spyOnEvent: (eventName: string) => Promise<EventSpy>;\n}\n\nexport const locator = (\n page: E2EPage,\n originalFn: typeof page.locator,\n selector: string,\n options?: LocatorOptions,\n): E2ELocator => {\n const locator = originalFn(selector, options) as E2ELocator;\n locator.spyOnEvent = async (eventName: string) => {\n const spy = new EventSpy(eventName);\n const handle = await locator.evaluateHandle((node: HTMLElement) => node);\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n return spy;\n };\n return locator;\n};\n", "import type { Page, TestInfo } from '@playwright/test';\n\nimport type { E2EPageOptions } from '../../playwright-declarations';\n\n/**\n * Overwrites the default Playwright page.setContent method.\n *\n * Navigates to a blank page, sets the content, and waits for the\n * Stencil components to be hydrated before proceeding with the test.\n *\n * @param page The Playwright page object.\n * @param html The HTML content to set on the page.\n * @param testInfo Test information from the test bed. Used to access base URL.\n * @param options The test config associated with the current test run.\n */\nexport const setContent = async (page: Page, html: string, testInfo: TestInfo, options?: E2EPageOptions) => {\n if (page.isClosed()) {\n throw new Error('setContent unavailable: page is already closed');\n }\n\n const baseUrl = testInfo.project.use.baseURL;\n const baseEntryPath = process.env.STENCIL_ENTRY_PATH;\n\n const output = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <title>Stencil Playwright Test</title>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0\" />\n <script src=\"${baseEntryPath}.js\" nomodule></script>\n <script type=\"module\" src=\"${baseEntryPath}.esm.js\"></script>\n </head>\n <body>\n ${html}\n </body>\n </html>\n `;\n\n if (baseUrl) {\n await page.route(baseUrl, (route) => {\n if (route.request().url() === `${baseUrl}/`) {\n /**\n * Intercepts the empty page request and returns the\n * HTML content that was passed in.\n */\n route.fulfill({\n status: 200,\n contentType: 'text/html',\n body: output,\n });\n } else {\n // Allow all other requests to pass through\n route.continue();\n }\n });\n\n await page.goto(`${baseUrl}#`, options);\n } else {\n throw new Error('setContent unavailable: no dev server base URL provided');\n }\n};\n", "import type { E2EPage } from '../../playwright-declarations';\nimport { addE2EListener, EventSpy } from '../event-spy';\n\nexport const spyOnEvent = async (page: E2EPage, eventName: string): Promise<EventSpy> => {\n const spy = new EventSpy(eventName);\n\n const handle = await page.evaluateHandle(() => window);\n\n await addE2EListener(page, handle, eventName, (ev: CustomEvent) => spy.push(ev));\n\n return spy;\n};\n", "import type { Page } from '@playwright/test';\nimport type { HostElement } from '@stencil/core/internal';\n\n/**\n * Waits for a combined threshold of a Stencil web component to be re-hydrated in the next repaint + 100ms.\n * Used for testing changes to a web component that does not modify CSS classes or introduce new DOM nodes.\n *\n * Original source: https://github.com/ionic-team/stencil/blob/main/src/testing/puppeteer/puppeteer-page.ts#L298-L363\n *\n * @param page The Playwright page object.\n * @param timeoutMs The time to wait for the changes to occur.\n */\nexport const waitForChanges = async (page: Page, timeoutMs = 100) => {\n try {\n if (page.isClosed()) {\n /**\n * If the page is already closed, we can skip the long execution of this method\n * and return early.\n */\n return;\n }\n await page.evaluate(() => {\n // BROWSER CONTEXT\n return new Promise<void>((resolve) => {\n // Wait for the next repaint to happen\n requestAnimationFrame(() => {\n const promiseChain: Promise<any>[] = [];\n\n const waitComponentOnReady = (elm: Element | ShadowRoot, promises: Promise<any>[]) => {\n if ('shadowRoot' in elm && elm.shadowRoot instanceof ShadowRoot) {\n waitComponentOnReady(elm.shadowRoot, promises);\n }\n const children = elm.children;\n const len = children.length;\n for (let i = 0; i < len; i++) {\n const childElm = children[i];\n const childStencilElm = childElm as HostElement;\n if (childElm.tagName.includes('-') && typeof childStencilElm.componentOnReady === 'function') {\n /**\n * We are only using the lazy loaded bundle\n * here so we can safely use the\n * componentOnReady method.\n */\n promises.push(childStencilElm.componentOnReady());\n }\n waitComponentOnReady(childElm, promises);\n }\n };\n\n waitComponentOnReady(document.documentElement, promiseChain);\n\n Promise.all(promiseChain)\n .then(() => resolve())\n .catch(() => resolve());\n });\n });\n });\n if (page.isClosed()) {\n return;\n }\n await page.waitForTimeout(timeoutMs);\n } catch (e) {\n console.error(e);\n }\n};\n", "import type {\n PlaywrightTestArgs,\n PlaywrightTestOptions,\n PlaywrightWorkerArgs,\n PlaywrightWorkerOptions,\n} from '@playwright/test';\nimport { test as base } from '@playwright/test';\n\nimport { loadConfigMeta } from './load-config-meta.js';\nimport { initPageEvents } from './page/event-spy';\nimport type { LocatorOptions } from './page/utils';\nimport { goto as goToPage, locator, setContent, spyOnEvent, waitForChanges } from './page/utils';\nimport type { BrowserNameOrCallback, E2EPage, E2EPageOptions, E2ESkip } from './playwright-declarations';\nimport { ProcessConstants } from './process-constants.js';\n\ntype CustomTestArgs = PlaywrightTestArgs &\n PlaywrightTestOptions &\n PlaywrightWorkerArgs &\n PlaywrightWorkerOptions & {\n page: E2EPage;\n };\n\ntype CustomFixtures = {\n page: E2EPage;\n skip: E2ESkip;\n};\n\n/**\n * Extends the base `page` test figure within Playwright.\n * @param page The page to extend.\n * @returns The modified playwright page with extended functionality.\n */\nasync function extendPageFixture(page: E2EPage) {\n // Make sure the Stencil namespace and entry path are set on the process so we can use them in the `setContent` tests.\n // These wouldn't be set if the user didn't setup the Playwright config with the `createConfig()` helper.\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE] || !process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n const { stencilNamespace, stencilEntryPath } = await loadConfigMeta();\n\n if (!process.env[ProcessConstants.STENCIL_NAMESPACE]) {\n process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;\n }\n if (!process.env[ProcessConstants.STENCIL_ENTRY_PATH]) {\n process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;\n }\n }\n\n const originalGoto = page.goto.bind(page);\n const originalLocator = page.locator.bind(page);\n\n await page.addInitScript(() => {\n window.addEventListener('appload', () => {\n (window as any).testAppLoaded = true;\n });\n });\n\n // Overridden Playwright methods\n page.goto = (url: string, options?: E2EPageOptions) => goToPage(page, url, originalGoto, options);\n page.setContent = (html: string, options?: E2EPageOptions) => setContent(page, html, test.info(), options);\n page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);\n\n // Custom adapter methods\n page.waitForChanges = (timeoutMs?: number) => waitForChanges(page, timeoutMs);\n page.spyOnEvent = (eventName: string) => spyOnEvent(page, eventName);\n\n // Custom event behavior\n await initPageEvents(page);\n\n return page;\n}\n\nexport const test = base.extend<CustomFixtures>({\n page: async ({ page }: CustomTestArgs, use: (r: E2EPage) => Promise<void>) => {\n page = await extendPageFixture(page);\n await use(page);\n },\n skip: {\n browser: (\n browserNameOrFunction: BrowserNameOrCallback,\n reason = `The functionality that is being tested is not applicable to this browser.`,\n ) => {\n const browserName = base.info().project.use.browserName!;\n\n if (typeof browserNameOrFunction === 'function') {\n base.skip(browserNameOrFunction(browserName), reason);\n } else {\n base.skip(browserName === browserNameOrFunction, reason);\n }\n },\n mode: (mode: string, reason = `The functionality that is being tested is not applicable to ${mode} mode`) => {\n base.skip(base.info().project.metadata.mode === mode, reason);\n },\n },\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAEA,QAAI,oBAAoB,SAASA,mBAAkB,OAAO;AACzD,aAAO,gBAAgB,KAAK,KACxB,CAAC,UAAU,KAAK;AAAA,IACrB;AAEA,aAAS,gBAAgB,OAAO;AAC/B,aAAO,CAAC,CAAC,SAAS,OAAO,UAAU;AAAA,IACpC;AAEA,aAAS,UAAU,OAAO;AACzB,UAAI,cAAc,OAAO,UAAU,SAAS,KAAK,KAAK;AAEtD,aAAO,gBAAgB,qBACnB,gBAAgB,mBAChB,eAAe,KAAK;AAAA,IACzB;AAGA,QAAI,eAAe,OAAO,WAAW,cAAc,OAAO;AAC1D,QAAI,qBAAqB,eAAe,OAAO,IAAI,eAAe,IAAI;AAEtE,aAAS,eAAe,OAAO;AAC9B,aAAO,MAAM,aAAa;AAAA,IAC3B;AAEA,aAAS,YAAY,KAAK;AACzB,aAAO,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;AAAA,IACnC;AAEA,aAAS,8BAA8B,OAAO,SAAS;AACtD,aAAQ,QAAQ,UAAU,SAAS,QAAQ,kBAAkB,KAAK,IAC/D,UAAU,YAAY,KAAK,GAAG,OAAO,OAAO,IAC5C;AAAA,IACJ;AAEA,aAAS,kBAAkB,QAAQ,QAAQ,SAAS;AACnD,aAAO,OAAO,OAAO,MAAM,EAAE,IAAI,SAAS,SAAS;AAClD,eAAO,8BAA8B,SAAS,OAAO;AAAA,MACtD,CAAC;AAAA,IACF;AAEA,aAAS,iBAAiB,KAAK,SAAS;AACvC,UAAI,CAAC,QAAQ,aAAa;AACzB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,iBAAiB,CAAC,cAAuB,eAAe,MAAM,SAAS;AAC5E,OAAK,aAAa,CAAC,cAAsB,WAAW,MAAM,SAAS;AAGnE,QAAM,eAAe,IAAI;AAEzB,SAAO;AACT;AAEO,IAAM,OAAO,KAAK,OAAuB;AAAA,EAC9C,MAAM,OAAO,EAAE,KAAK,GAAmB,QAAuC;AAC5E,WAAO,MAAM,kBAAkB,IAAI;AACnC,UAAM,IAAI,IAAI;AAAA,EAChB;AAAA,EACA,MAAM;AAAA,IACJ,SAAS,CACP,uBACA,SAAS,gFACN;AACH,YAAM,cAAc,KAAK,KAAK,EAAE,QAAQ,IAAI;AAE5C,UAAI,OAAO,0BAA0B,YAAY;AAC/C,aAAK,KAAK,sBAAsB,WAAW,GAAG,MAAM;AAAA,MACtD,OAAO;AACL,aAAK,KAAK,gBAAgB,uBAAuB,MAAM;AAAA,MACzD;AAAA,IACF;AAAA,IACA,MAAM,CAAC,MAAc,SAAS,+DAA+D,IAAI,YAAY;AAC3G,WAAK,KAAK,KAAK,KAAK,EAAE,QAAQ,SAAS,SAAS,MAAM,MAAM;AAAA,IAC9D;AAAA,EACF;AACF,CAAC;",
6
6
  "names": ["isMergeableObject", "path", "process", "process", "fileURLToPath", "toPath", "path", "toPath", "merge", "deepEqual", "import_fast_deep_equal", "expect", "deepEqual", "import_fast_deep_equal", "expect", "deepEqual", "eventName", "id", "locator"]
7
7
  }
@@ -5,8 +5,4 @@ import type { E2EPageOptions } from '../../playwright-declarations';
5
5
  * the normal `page.goto` work, this code also automatically waits for the Stencil components
6
6
  * to be hydrated before proceeding with the test.
7
7
  */
8
- export declare const goto: (page: Page, url: string, originalFn: (url: string, options?: {
9
- referer?: string | undefined;
10
- timeout?: number | undefined;
11
- waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit" | undefined;
12
- } | undefined) => Promise<import("playwright-core").Response | null>, options?: E2EPageOptions) => Promise<import("playwright-core").Response | null>;
8
+ export declare const goto: (page: Page, url: string, originalFn: typeof page.goto, options?: E2EPageOptions) => Promise<import("playwright-core").Response | null>;
@@ -18,4 +18,4 @@ export interface E2ELocator extends Locator {
18
18
  */
19
19
  spyOnEvent: (eventName: string) => Promise<EventSpy>;
20
20
  }
21
- export declare const locator: (page: E2EPage, originalFn: (selector: string, options?: LocatorOptions | undefined) => E2ELocator, selector: string, options?: LocatorOptions) => E2ELocator;
21
+ export declare const locator: (page: E2EPage, originalFn: typeof page.locator, selector: string, options?: LocatorOptions) => E2ELocator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/playwright",
3
- "version": "0.2.1",
3
+ "version": "0.2.2-dev.1763311619.b0d6b9d",
4
4
  "description": "Testing adapter to use Playwright with Stencil",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "scripts": {
12
12
  "build": "npm run build.empty && npm run build.types && npm run build.bundle",
13
- "build.empty": "rm -rf ./dist && rm -f ./build/build.js",
13
+ "build.empty": "rimraf ./dist ./build/build.js",
14
14
  "build.types": "tsc --emitDeclarationOnly --outDir ./dist",
15
15
  "build.bundle": "tsc ./build/build.ts && node ./build/build.js",
16
16
  "format": "npm run format.base -- --write",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "git+https://github.com/ionic-team/stencil-playwright.git"
25
+ "url": "https://github.com/stenciljs/playwright"
26
26
  },
27
27
  "keywords": [
28
28
  "stencil",
@@ -32,9 +32,9 @@
32
32
  "author": "Stencil Team",
33
33
  "license": "MIT",
34
34
  "bugs": {
35
- "url": "https://github.com/ionic-team/stencil-playwright/issues"
35
+ "url": "https://github.com/stenciljs/playwright/issues"
36
36
  },
37
- "homepage": "https://github.com/ionic-team/stencil-playwright#readme",
37
+ "homepage": "https://github.com/stenciljs/playwright#readme",
38
38
  "engines": {
39
39
  "node": ">=12.0.0",
40
40
  "npm": ">=6.0.0"
@@ -48,30 +48,34 @@
48
48
  "@stencil/core": ">=4.13.0"
49
49
  },
50
50
  "devDependencies": {
51
+ "@eslint/js": "^9.38.0",
51
52
  "@ionic/prettier-config": "^4.0.0",
52
53
  "@playwright/test": "^1.41.2",
53
- "@stencil/core": "^4.13.0",
54
- "@types/eslint": "^8.56.2",
55
- "@types/jest": "^29.5.12",
56
- "@types/node": "^20.11.19",
57
- "@typescript-eslint/eslint-plugin": "^7.0.2",
58
- "@typescript-eslint/parser": "^7.0.2",
59
- "cspell": "^8.6.0",
60
- "esbuild": "^0.20.1",
61
- "eslint": "^8.56.0",
62
- "eslint-config-prettier": "^9.1.0",
63
- "eslint-plugin-jsdoc": "^48.2.0",
64
- "eslint-plugin-simple-import-sort": "^12.0.0",
65
- "eslint-plugin-unused-imports": "^3.1.0",
66
- "jest": "^29.7.0",
67
- "prettier": "^3.2.5",
68
- "ts-jest": "^29.1.2",
54
+ "@stencil/core": "^4.38.2",
55
+ "@types/eslint": "^9.6.1",
56
+ "@types/jest": "^30.0.0",
57
+ "@types/node": "^24.9.2",
58
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
59
+ "@typescript-eslint/parser": "^8.46.2",
60
+ "cspell": "^9.2.2",
61
+ "esbuild": "^0.25.11",
62
+ "eslint": "^9.38.0",
63
+ "eslint-config-prettier": "^10.1.8",
64
+ "eslint-plugin-jsdoc": "^61.1.11",
65
+ "eslint-plugin-simple-import-sort": "^12.1.1",
66
+ "eslint-plugin-unused-imports": "^4.3.0",
67
+ "jest": "^30.2.0",
68
+ "prettier": "^3.6.2",
69
+ "rimraf": "^6.0.1",
70
+ "ts-jest": "^29.4.5",
69
71
  "ts-node": "^10.9.2",
70
- "typescript": "^5.3.3"
72
+ "typescript": "^5.9.3",
73
+ "typescript-eslint": "^8.46.2",
74
+ "globals": "^14.0.0"
71
75
  },
72
76
  "prettier": "@ionic/prettier-config",
73
77
  "dependencies": {
74
78
  "deepmerge": "^4.3.1",
75
- "find-up": "^7.0.0"
79
+ "find-up": "^8.0.0"
76
80
  }
77
81
  }