diff --git a/source/npm/util.js b/source/npm/util.js index 9a1e6dfe..6fe00c47 100644 --- a/source/npm/util.js +++ b/source/npm/util.js @@ -193,7 +193,8 @@ function getIgnoredFilesGlob(globArrayFromFilesProperty, packageDirectories) { 'node_modules/**/*', 'npm-debug.log', 'package-lock.json', - '.git/**/*' + '.git/**/*', + '.git' ]; // Test files are assumed not to be part of the package diff --git a/test/fixtures/npmignore/README.txt b/test/fixtures/npmignore/README.txt new file mode 100644 index 00000000..5086e7b4 --- /dev/null +++ b/test/fixtures/npmignore/README.txt @@ -0,0 +1 @@ +File is always included in package. diff --git a/test/fixtures/npmignore/readme.md b/test/fixtures/npmignore/readme.md new file mode 100644 index 00000000..5086e7b4 --- /dev/null +++ b/test/fixtures/npmignore/readme.md @@ -0,0 +1 @@ +File is always included in package. diff --git a/test/integration.js b/test/integration.js index b1a0b1e1..6be08bac 100644 --- a/test/integration.js +++ b/test/integration.js @@ -1,6 +1,11 @@ const test = require('ava'); const execa = require('execa'); +test.before(async () => { + await execa('git', ['submodule', 'update', '--remote']); + await execa('npm', ['i'], {cwd: 'integration-test'}); +}); + test('Integration tests', async t => { await execa('ava', {cwd: 'integration-test'}); t.pass(); diff --git a/test/npmignore.js b/test/npmignore.js index 8af48236..89c11513 100644 --- a/test/npmignore.js +++ b/test/npmignore.js @@ -6,7 +6,9 @@ const newFiles = [ 'source/ignore.txt', 'source/pay_attention.txt', '.hg', - 'test/file.txt' + 'test/file.txt', + 'readme.md', + 'README.txt' ]; test('ignored files using file-attribute in package.json with one file', async t => {