Skip to content

Commit 79b93df

Browse files
committed
fix(test-runner-junit-reporter): update XML snapshots for workspace cwd
npm workspaces run test scripts from the package directory, not the repo root. The test runner computes file paths relative to cwd, so XML output paths are now relative to the package root (test/fixtures/...) instead of the repo root (packages/test-runner-junit-reporter/test/...). Updated expected XML snapshots to match. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f83cb3a commit 79b93df

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuites>
3-
<testsuite name="Chrome_puppeteer_/packages/test-runner-junit-reporter/test/fixtures/multiple/nested-test.js" id="0" tests="1" skipped="0" errors="0" failures="0" time="<<computed>>">
3+
<testsuite name="Chrome_puppeteer_/test/fixtures/multiple/nested-test.js" id="0" tests="1" skipped="0" errors="0" failures="0" time="<<computed>>">
44
<properties>
5-
<property name="test.fileName" value="packages/test-runner-junit-reporter/test/fixtures/multiple/nested-test.js"/>
5+
<property name="test.fileName" value="test/fixtures/multiple/nested-test.js"/>
66
<property name="browser.name" value="Chrome"/>
77
<property name="browser.launcher" value="puppeteer"/>
88
</properties>
9-
<testcase name="is equivalent to map (f.g) f a" time="<<computed>>" classname="given a functor f and a function a -&gt; b map f map g f a" file="packages/test-runner-junit-reporter/test/fixtures/multiple/nested-test.js"/>
9+
<testcase name="is equivalent to map (f.g) f a" time="<<computed>>" classname="given a functor f and a function a -&gt; b map f map g f a" file="test/fixtures/multiple/nested-test.js"/>
1010
</testsuite>
11-
<testsuite name="Chrome_puppeteer_/packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js" id="0" tests="5" skipped="1" errors="1" failures="1" time="<<computed>>">
11+
<testsuite name="Chrome_puppeteer_/test/fixtures/multiple/simple-test.js" id="0" tests="5" skipped="1" errors="1" failures="1" time="<<computed>>">
1212
<properties>
13-
<property name="test.fileName" value="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js"/>
13+
<property name="test.fileName" value="test/fixtures/multiple/simple-test.js"/>
1414
<property name="browser.name" value="Chrome"/>
1515
<property name="browser.launcher" value="puppeteer"/>
1616
</properties>
17-
<testcase name="under addition" time="<<computed>>" classname="real numbers forming a monoid" file="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js"/>
18-
<testcase name="null hypothesis" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js"/>
19-
<testcase name="asserts error" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js" line="15">
17+
<testcase name="under addition" time="<<computed>>" classname="real numbers forming a monoid" file="test/fixtures/multiple/simple-test.js"/>
18+
<testcase name="null hypothesis" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/multiple/simple-test.js"/>
19+
<testcase name="asserts error" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/multiple/simple-test.js" line="15">
2020
<failure message="expected false to be true" type="AssertionError"><![CDATA[AssertionError: expected false to be true
21-
at <<anonymous>> (packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js:15:29)]]></failure>
21+
at <<anonymous>> (test/fixtures/multiple/simple-test.js:15:29)]]></failure>
2222
</testcase>
23-
<testcase name="tbd: confirm true positive" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js">
23+
<testcase name="tbd: confirm true positive" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/multiple/simple-test.js">
2424
<skipped/>
2525
</testcase>
26-
<testcase name="reports logs to JUnit" time="<<computed>>" classname="logging during a test" file="packages/test-runner-junit-reporter/test/fixtures/multiple/simple-test.js"/>
26+
<testcase name="reports logs to JUnit" time="<<computed>>" classname="logging during a test" file="test/fixtures/multiple/simple-test.js"/>
2727
</testsuite>
2828
</testsuites>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuites>
3-
<testsuite name="Chrome_puppeteer_/packages/test-runner-junit-reporter/test/fixtures/nested/nested-test.js" id="0" tests="1" skipped="0" errors="0" failures="0" time="<<computed>>">
3+
<testsuite name="Chrome_puppeteer_/test/fixtures/nested/nested-test.js" id="0" tests="1" skipped="0" errors="0" failures="0" time="<<computed>>">
44
<properties>
5-
<property name="test.fileName" value="packages/test-runner-junit-reporter/test/fixtures/nested/nested-test.js"/>
5+
<property name="test.fileName" value="test/fixtures/nested/nested-test.js"/>
66
<property name="browser.name" value="Chrome"/>
77
<property name="browser.launcher" value="puppeteer"/>
88
</properties>
9-
<testcase name="is equivalent to map (f.g) f a" time="<<computed>>" classname="given a functor f and a function a -&gt; b map f map g f a" file="packages/test-runner-junit-reporter/test/fixtures/nested/nested-test.js"/>
9+
<testcase name="is equivalent to map (f.g) f a" time="<<computed>>" classname="given a functor f and a function a -&gt; b map f map g f a" file="test/fixtures/nested/nested-test.js"/>
1010
</testsuite>
1111
</testsuites>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuites>
3-
<testsuite name="Chrome_puppeteer_/packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" id="0" tests="6" skipped="1" errors="2" failures="2" time="<<computed>>">
3+
<testsuite name="Chrome_puppeteer_/test/fixtures/simple/simple-test.js" id="0" tests="6" skipped="1" errors="2" failures="2" time="<<computed>>">
44
<properties>
5-
<property name="test.fileName" value="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
5+
<property name="test.fileName" value="test/fixtures/simple/simple-test.js"/>
66
<property name="browser.name" value="Chrome"/>
77
<property name="browser.launcher" value="puppeteer"/>
88
</properties>
9-
<testcase name="under addition" time="<<computed>>" classname="real numbers forming a monoid" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
10-
<testcase name="null hypothesis" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
11-
<testcase name="asserts error" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" line="17">
9+
<testcase name="under addition" time="<<computed>>" classname="real numbers forming a monoid" file="test/fixtures/simple/simple-test.js"/>
10+
<testcase name="null hypothesis" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/simple/simple-test.js"/>
11+
<testcase name="asserts error" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/simple/simple-test.js" line="17">
1212
<failure message="expected false to be true" type="AssertionError"><![CDATA[AssertionError: expected false to be true
13-
at <<anonymous>> (packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js:17:29)]]></failure>
13+
at <<anonymous>> (test/fixtures/simple/simple-test.js:17:29)]]></failure>
1414
</testcase>
15-
<testcase name="tbd: confirm true positive" time="<<computed>>" classname="off-by-one boolean logic errors" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js">
15+
<testcase name="tbd: confirm true positive" time="<<computed>>" classname="off-by-one boolean logic errors" file="test/fixtures/simple/simple-test.js">
1616
<skipped/>
1717
</testcase>
18-
<testcase name="reports logs to JUnit" time="<<computed>>" classname="logging during a test" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js"/>
19-
<testcase name="fails with source trace" time="<<computed>>" classname="logging during a test" file="packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js" line="2">
18+
<testcase name="reports logs to JUnit" time="<<computed>>" classname="logging during a test" file="test/fixtures/simple/simple-test.js"/>
19+
<testcase name="fails with source trace" time="<<computed>>" classname="logging during a test" file="test/fixtures/simple/simple-test.js" line="2">
2020
<failure message="failed" type="Error"><![CDATA[Error: failed
21-
at fail (packages/test-runner-junit-reporter/test/fixtures/simple/simple-source.js:2:9)
22-
at <<anonymous>> (packages/test-runner-junit-reporter/test/fixtures/simple/simple-test.js:33:17)]]></failure>
21+
at fail (test/fixtures/simple/simple-source.js:2:9)
22+
at <<anonymous>> (test/fixtures/simple/simple-test.js:33:17)]]></failure>
2323
</testcase>
2424
</testsuite>
2525
</testsuites>

packages/test-runner-junit-reporter/test/junitReporter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const NON_ZERO_TIME_VALUE_REGEX = /time="((\d\.\d+)|(\d))"/g;
1313

1414
const USER_AGENT_STRING_REGEX = /"Mozilla\/5\.0 (.*)"/g;
1515

16-
const rootDir = path.join(import.meta.dirname, '..', '..', '..');
16+
const rootDir = path.resolve(import.meta.dirname, '..', '..', '..');
1717

1818
const normalizeOutput = (cwd: string, output: string) =>
1919
output

0 commit comments

Comments
 (0)