Skip to content

Commit 60812c2

Browse files
committed
fix(tests): normalize npm-packlist paths
1 parent c2bc162 commit 60812c2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/npm/publish.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
const path = require('path')
12
const npmPacklist = require('npm-packlist')
23

34
module.exports = {getPublishableFiles}
45

5-
function getPublishableFiles(path) {
6-
return npmPacklist({path})
6+
function getPublishableFiles(basePath) {
7+
return npmPacklist({basePath}).then(files => files.map(file => path.normalize(file)))
78
}

test/verify.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const pkg = require('../package.json')
55

66
const baseFixturesDir = path.join(__dirname, 'fixtures', 'verify')
77
const sanipack = path.resolve(__dirname, '..', pkg.bin.sanipack)
8-
const normalize = (dirPath) => dirPath.replace(/\//g, path.sep)
8+
const normalize = (dirPath) => path.normalize(dirPath)
99
const options = {timeout: 15000}
1010

1111
tap.test('can verify valid plugin (in cwd)', options, async (t) => {

0 commit comments

Comments
 (0)