Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show files added since the last release and not part of the package (#…
…456) Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
- Loading branch information
1 parent
0cff2b4
commit 08a2c06
Showing
22 changed files
with
280 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "integration-test"] | ||
path = integration-test | ||
url = https://github.com/bunysae/np_integration_test |
Submodule integration-test
added at
ad5e6e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
should be ignored by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore.txt | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is always included in package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is always included in package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ignore this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is excluded from .npmignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ignore this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
should be ignored by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"files": ["pay_attention.txt"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File is excluded from package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File in included in package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The directory is for the resources | ||
in the script npmignore.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const test = require('ava'); | ||
const execa = require('execa'); | ||
|
||
test.after.always(async () => { | ||
await execa('git', ['submodule', 'update', '--remote']); | ||
}); | ||
|
||
test('Integration tests', async t => { | ||
await execa('ava', {cwd: 'integration-test'}); | ||
t.pass(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import path from 'path'; | ||
import test from 'ava'; | ||
import proxyquire from 'proxyquire'; | ||
|
||
const newFiles = [ | ||
'source/ignore.txt', | ||
'source/pay_attention.txt', | ||
'.hg', | ||
'test/file.txt', | ||
'readme.md', | ||
'README.txt' | ||
]; | ||
|
||
test('ignored files using file-attribute in package.json with one file', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['pay_attention.txt']}, newFiles), ['source/ignore.txt']); | ||
}); | ||
|
||
test('ignored file using file-attribute in package.json with directory', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source']}, newFiles), []); | ||
}); | ||
|
||
test('ignored test files using files attribute and directory structure in package.json', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source'], directories: {test: 'test-tap'}}, newFiles), ['test/file.txt']); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source'], directories: {test: ['test-tap']}}, newFiles), ['test/file.txt']); | ||
}); | ||
|
||
test('ignored files using .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({name: 'npmignore'}, newFiles), ['source/ignore.txt']); | ||
}); | ||
|
||
test('ignored test files using files attribute and .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({directories: {test: 'test-tap'}}, newFiles), ['source/ignore.txt', 'test/file.txt']); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({directories: {test: ['test-tap']}}, newFiles), ['source/ignore.txt', 'test/file.txt']); | ||
}); | ||
|
||
test('dot files using files attribute', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'package') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({files: ['source']}, ['test/.dotfile']), []); | ||
}); | ||
|
||
test('dot files using .npmignore', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures', 'npmignore') | ||
} | ||
}); | ||
t.deepEqual(await testedModule.getNewAndUnpublishedFiles({}, ['test/.dot']), []); | ||
}); | ||
|
||
test('ignore strategy is not used', async t => { | ||
const testedModule = proxyquire('../source/npm/util', { | ||
'pkg-dir': | ||
{ | ||
sync: () => path.resolve('test', 'fixtures') | ||
} | ||
}); | ||
t.is(await testedModule.getNewAndUnpublishedFiles({name: 'no ignore strategy'}, newFiles), undefined); | ||
}); |