Skip to content

Commit

Permalink
yarn workspaces test for .vscodeignore functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
sebas2day committed Mar 3, 2021
1 parent cb5cf34 commit ebc6e62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
log
1 change: 1 addition & 0 deletions src/test/fixtures/yarnWorkspaces/packageA/logger.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
log
5 changes: 5 additions & 0 deletions src/test/fixtures/yarnWorkspaces/packageB/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pattern of file name
../node_modules/package-a/*.log

# include files using negate
!../node_modules/package-a/important
7 changes: 7 additions & 0 deletions src/test/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ describe('collect', function () {
path: 'extension/node_modules/package-a/package.json',
localPath: path.resolve(root, 'node_modules/package-a/package.json')
},
{
path: 'extension/node_modules/package-a/important/prod.log',
localPath: path.resolve(root, 'node_modules/package-a/important/prod.log')
},
{
path: 'extension/node_modules/curry/curry.js',
localPath: path.resolve(root, 'node_modules/curry/curry.js')
Expand All @@ -297,6 +301,9 @@ describe('collect', function () {
assert.equal(found.localPath, expected.localPath, 'localPath');
}
})
const ignoreFilename = 'extension/node_modules/package-a/logger.log';
const ignore = files.find(f => f.path === ignoreFilename);
assert.ok(!ignore, 'should ignore ' + ignoreFilename)
})
});

Expand Down

0 comments on commit ebc6e62

Please sign in to comment.