playwright-test-explorer 0.0.3 → 0.0.5

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.
@@ -857,7 +857,7 @@ async function listTestFile(workspaceFolder = process.cwd(), configFile = "playw
857
857
  try {
858
858
  const output = { projects: (await testServer.listFiles()).projects.map((project) => ({
859
859
  ...project,
860
- files: project.files.map((filePath) => path.relative(workspaceFolder, filePath))
860
+ files: project.files.map((filePath) => path.relative(workspaceFolder, filePath).replace(/\\/g, "/"))
861
861
  })) };
862
862
  const jsonString = JSON.stringify(output, null, 2);
863
863
  if (outputFile) {
@@ -880,14 +880,14 @@ async function listTestCase(workspaceFolder = process.cwd(), configFile = "playw
880
880
  const node = {
881
881
  type: "suite",
882
882
  title: s.title || "Root",
883
- file: s.location ? path.relative(workspaceFolder, s.location.file) : void 0,
883
+ file: s.location ? path.relative(workspaceFolder, s.location.file).replace(/\\/g, "/") : void 0,
884
884
  children: []
885
885
  };
886
886
  if (s.tests) for (const test of s.tests) node.children.push({
887
887
  type: "test",
888
888
  title: test.title,
889
889
  location: {
890
- file: path.relative(workspaceFolder, test.location.file),
890
+ file: path.relative(workspaceFolder, test.location.file).replace(/\\/g, "/"),
891
891
  line: test.location.line,
892
892
  column: test.location.column
893
893
  },
@@ -916,9 +916,8 @@ async function listTestCase(workspaceFolder = process.cwd(), configFile = "playw
916
916
  if ((await fs.stat(absolutePath)).isDirectory()) {
917
917
  const files = await testServer.listFiles();
918
918
  for (const project of files.projects) for (const file of project.files) {
919
- const relativeFile = path.relative(workspaceFolder, file);
920
- const normalizedFile = relativeFile.replace(/\\/g, "/");
921
- if (normalizedFile.startsWith(normalizedInputPath + "/") || normalizedFile === normalizedInputPath) expandedPaths.push(relativeFile);
919
+ const relativeFile = path.relative(workspaceFolder, file).replace(/\\/g, "/");
920
+ if (relativeFile.startsWith(normalizedInputPath + "/") || relativeFile === normalizedInputPath) expandedPaths.push(relativeFile);
922
921
  }
923
922
  } else expandedPaths.push(relativePath);
924
923
  } catch {
@@ -942,14 +941,14 @@ async function treeStructure(workspaceFolder = process.cwd(), configFile = "play
942
941
  const node = {
943
942
  type: "suite",
944
943
  title: s.title || "Root",
945
- file: s.location ? path.relative(workspaceFolder, s.location.file) : void 0,
944
+ file: s.location ? path.relative(workspaceFolder, s.location.file).replace(/\\/g, "/") : void 0,
946
945
  children: []
947
946
  };
948
947
  if (s.tests) for (const test of s.tests) node.children.push({
949
948
  type: "test",
950
949
  title: test.title,
951
950
  location: {
952
- file: path.relative(workspaceFolder, test.location.file),
951
+ file: path.relative(workspaceFolder, test.location.file).replace(/\\/g, "/"),
953
952
  line: test.location.line,
954
953
  column: test.location.column
955
954
  },
@@ -975,7 +974,7 @@ async function treeStructure(workspaceFolder = process.cwd(), configFile = "play
975
974
  const allRelativePaths = [];
976
975
  for (const project of files.projects) if (project.files.length > 0) {
977
976
  const relativePaths = project.files.map((absolutePath) => {
978
- return path.relative(workspaceFolder, absolutePath);
977
+ return path.relative(workspaceFolder, absolutePath).replace(/\\/g, "/");
979
978
  });
980
979
  allRelativePaths.push(...relativePaths);
981
980
  }
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as CancellationToken, n as listTestFile, r as treeStructure, t as listTestCase } from "./api-CyzEW-tV.js";
2
+ import { i as CancellationToken, n as listTestFile, r as treeStructure, t as listTestCase } from "./api-DqaqZS_A.js";
3
3
  import { program } from "commander";
4
4
  import chalk from "chalk";
5
5
  import ora from "ora";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as listTestFile, r as treeStructure, t as listTestCase } from "./api-CyzEW-tV.js";
1
+ import { n as listTestFile, r as treeStructure, t as listTestCase } from "./api-DqaqZS_A.js";
2
2
 
3
3
  export { listTestCase, listTestFile, treeStructure };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-test-explorer",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "A CLI tool and library for exploring Playwright tests",
5
5
  "type": "module",
6
6
  "license": "MIT",