playwright-test-explorer 0.0.1 → 0.0.2

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.
@@ -855,7 +855,10 @@ async function listTestFile(workspaceFolder = process.cwd(), configFile = "playw
855
855
  configFile: path.join(workspaceFolder, configFile)
856
856
  });
857
857
  try {
858
- const output = { projects: (await testServer.listFiles()).projects };
858
+ const output = { projects: (await testServer.listFiles()).projects.map((project) => ({
859
+ ...project,
860
+ files: project.files.map((filePath) => path.relative(workspaceFolder, filePath))
861
+ })) };
859
862
  const jsonString = JSON.stringify(output, null, 2);
860
863
  if (outputFile) {
861
864
  await fs.writeFile(outputFile, jsonString, "utf-8");
@@ -877,7 +880,7 @@ async function listTestCase(workspaceFolder = process.cwd(), configFile = "playw
877
880
  function walkSuite(s) {
878
881
  if (s.tests) for (const test of s.tests) tests.push({
879
882
  title: test.title,
880
- file: test.location.file,
883
+ file: path.relative(workspaceFolder, test.location.file),
881
884
  line: test.location.line,
882
885
  column: test.location.column,
883
886
  tags: test.tags || [],
@@ -915,14 +918,14 @@ async function treeStructure(workspaceFolder = process.cwd(), configFile = "play
915
918
  const node = {
916
919
  type: "suite",
917
920
  title: s.title || "Root",
918
- file: s.location ? s.location.file : void 0,
921
+ file: s.location ? path.relative(workspaceFolder, s.location.file) : void 0,
919
922
  children: []
920
923
  };
921
924
  if (s.tests) for (const test of s.tests) node.children.push({
922
925
  type: "test",
923
926
  title: test.title,
924
927
  location: {
925
- file: test.location.file,
928
+ file: path.relative(workspaceFolder, test.location.file),
926
929
  line: test.location.line,
927
930
  column: test.location.column
928
931
  },
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-DuYXKbq5.js";
2
+ import { i as CancellationToken, n as listTestFile, r as treeStructure, t as listTestCase } from "./api-Dpe-8gQe.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-DuYXKbq5.js";
1
+ import { n as listTestFile, r as treeStructure, t as listTestCase } from "./api-Dpe-8gQe.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.1",
3
+ "version": "0.0.2",
4
4
  "description": "A CLI tool and library for exploring Playwright tests",
5
5
  "type": "module",
6
6
  "license": "MIT",