Skip to content

Commit

Permalink
Fix files prompt when no new or unpublished files can be found (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaisteinherz authored Nov 19, 2021
1 parent dddd07c commit 5d2377f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@
"!test/fixtures",
"!integration-test"
]
},
"xo": {
"ignores": [
"integration-test"
]
}
}
2 changes: 2 additions & 0 deletions source/npm/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ exports.getNewAndUnpublishedFiles = async (pkg, newFiles = []) => {
if (npmignoreExistsInPackageRootDir()) {
return getFilesIgnoredByDotnpmignore(pkg, newFiles);
}

return [];
};

exports.getFirstTimePublishedFiles = async (pkg, newFiles = []) => {
Expand Down
2 changes: 1 addition & 1 deletion test/npmignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test('ignored files - ignore strategy is not used', async t => {
sync: () => path.resolve('test', 'fixtures')
}
});
t.is(await testedModule.getNewAndUnpublishedFiles({name: 'no ignore strategy'}, newFiles), undefined);
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({name: 'no ignore strategy'}, newFiles), []);
});

test('first time published files using file-attribute in package.json with one file', async t => {
Expand Down

0 comments on commit 5d2377f

Please sign in to comment.