Skip to content

Commit

Permalink
fix(tests): normalize npm-packlist paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hdoro committed Oct 11, 2021
1 parent c2bc162 commit 60812c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/npm/publish.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const path = require('path')
const npmPacklist = require('npm-packlist')

module.exports = {getPublishableFiles}

function getPublishableFiles(path) {
return npmPacklist({path})
function getPublishableFiles(basePath) {
return npmPacklist({basePath}).then(files => files.map(file => path.normalize(file)))
}
2 changes: 1 addition & 1 deletion test/verify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const pkg = require('../package.json')

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

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

0 comments on commit 60812c2

Please sign in to comment.