Skip to content

Commit 08f8d9f

Browse files
committed
Fix unit tests under windows
1 parent 1216290 commit 08f8d9f

File tree

9 files changed

+8
-8
lines changed

9 files changed

+8
-8
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const downloadPmd = async function(version, token) {
2222
core.info(`Using PMD ${pmdVersion} from cached path ${cachedPmdPath}`);
2323
return {
2424
version: pmdVersion,
25-
path: `${cachedPmdPath}/pmd-bin-${pmdVersion}`
25+
path: path.join(cachedPmdPath, `pmd-bin-${pmdVersion}`)
2626
}
2727
}
2828

tests/data/pmd-bin-6.39.0.zip

3 Bytes
Binary file not shown.

tests/data/pmd-bin-6.39.0/pmd.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
echo Running PMD 6.39.0 with: %*
2+
echo Running PMD 6.39.0 with: pmd %*
33

44
(
55
echo {

tests/data/pmd-bin-6.40.0.zip

3 Bytes
Binary file not shown.

tests/data/pmd-bin-6.40.0/bin/pmd.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
echo Running PMD 6.40.0 with: %*
2+
echo Running PMD 6.40.0 with: pmd %*
33

44
(
55
echo {

tests/data/pmd-bin-6.41.0.zip

3 Bytes
Binary file not shown.

tests/data/pmd-bin-6.41.0/bin/pmd.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
echo Running PMD 6.41.0 with: %*
2+
echo Running PMD 6.41.0 with: pmd %*
33

44
(
55
echo {

tests/util.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('pmd-github-action-util', function () {
5858

5959
const pmdInfo = await util.downloadPmd('latest', 'my_test_token');
6060

61-
const toolCache = path.normalize(path.join(cachePath, 'pmd', '6.40.0', os.arch(), 'pmd-bin-6.40.0'));
61+
const toolCache = path.join(cachePath, 'pmd', '6.40.0', os.arch(), 'pmd-bin-6.40.0');
6262
expect(pmdInfo).toStrictEqual({ path: toolCache, version: '6.40.0' });
6363
await expect(fs.access(toolCache)).resolves.toBe(undefined);
6464
})
@@ -74,7 +74,7 @@ describe('pmd-github-action-util', function () {
7474
.replyWithFile(200, __dirname + '/data/pmd-bin-6.39.0.zip');
7575
const pmdInfo = await util.downloadPmd('6.39.0', 'my_test_token');
7676

77-
const toolCache = path.normalize(path.join(cachePath, 'pmd', '6.39.0', os.arch(), 'pmd-bin-6.39.0'));
77+
const toolCache = path.join(cachePath, 'pmd', '6.39.0', os.arch(), 'pmd-bin-6.39.0');
7878
expect(pmdInfo).toStrictEqual({ path: toolCache, version: '6.39.0' });
7979
await expect(fs.access(toolCache)).resolves.toBe(undefined);
8080
})
@@ -93,7 +93,7 @@ describe('pmd-github-action-util', function () {
9393
const pmdInfo = await util.downloadPmd('6.39.0', 'my_test_token');
9494
const pmdInfo2 = await util.downloadPmd('6.39.0', 'my_test_token');
9595

96-
const toolCache = path.normalize(path.join(cachePath, 'pmd', '6.39.0', os.arch(), 'pmd-bin-6.39.0'));
96+
const toolCache = path.join(cachePath, 'pmd', '6.39.0', os.arch(), 'pmd-bin-6.39.0');
9797
expect(pmdInfo).toStrictEqual({ path: toolCache, version: '6.39.0' });
9898
expect(pmdInfo2).toStrictEqual({ path: pmdInfo.path, version: '6.39.0' });
9999
await expect(fs.access(toolCache)).resolves.toBe(undefined);

0 commit comments

Comments
 (0)