@midscene/test 1.15.1-beta-20261012042221.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
2
2
  import { pathToFileURL } from "node:url";
3
3
  import { require as api_require } from "tsx/cjs/api";
4
- import { tsImport } from "tsx/esm/api";
5
4
  import { NodeRegistry, WorkflowError, WorkflowExecutionFailure, WorkflowParseError, WorkflowPublicationError, asExecutionError, buildTestRunReportDump, classifyWorkflowDocumentFormat, collectTestRunReportSources, createProjectRuntime, isFatalDeviceError, normalizeSteps, runConcurrentJobs, runDocumentAttempts, runWorkflowDocument } from "@midscene/core/internal/test-runner";
6
5
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync } from "node:fs";
7
6
  import { globSync } from "tinyglobby";
@@ -268,10 +267,14 @@ async function loadTestProject(configPath) {
268
267
  const extension = assertSupportedConfig(absolutePath);
269
268
  let loaded;
270
269
  try {
271
- loaded = '.mjs' === extension ? await import(pathToFileURL(absolutePath).href) : await tsImport(pathToFileURL(absolutePath).href, {
272
- parentURL: pathToFileURL(`${dirname(absolutePath)}${sep}`).href,
273
- tsconfig: false
274
- });
270
+ if ('.mjs' === extension) loaded = await import(pathToFileURL(absolutePath).href);
271
+ else {
272
+ const { tsImport } = await import("tsx/esm/api");
273
+ loaded = await tsImport(pathToFileURL(absolutePath).href, {
274
+ parentURL: pathToFileURL(`${dirname(absolutePath)}${sep}`).href,
275
+ tsconfig: false
276
+ });
277
+ }
275
278
  } catch (error) {
276
279
  try {
277
280
  if ('.mjs' === extension || !canRetryWithCjsLoader(error)) throw error;