-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3dfb7d4
commit 895b7a3
Showing
3 changed files
with
30 additions
and
32 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
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,29 @@ | ||
process.argv.push('--quiet'); | ||
const checkChunk = require("./checkChunk"); | ||
|
||
const vendor1 = './node_modules/mkFullPathSync/babel'; | ||
const vendor2 = './mkFullPathSync/node_modules/core-js'; | ||
const regular = './regular/test' | ||
const excluded = ['babel', 'core-js'] | ||
|
||
|
||
describe('Test utils/checkChunk.js', () => { | ||
|
||
it(`Should return false if a module comes empty`, () => { | ||
expect(checkChunk('', [])).toBe(false); | ||
}); | ||
|
||
it(`Should detect if a module is at included`, () => { | ||
expect(checkChunk(vendor1, [], ['node_modules'])).toBe(true); | ||
expect(checkChunk(vendor2, [], ['node_modules'])).toBe(true); | ||
}); | ||
|
||
it(`Should detect if a module comes from included but is excluded`, () => { | ||
expect(checkChunk(vendor1, [], ['node_modules'])).toBe(true); | ||
expect(checkChunk(vendor1, excluded, ['node_modules'])).toBe(false); | ||
}); | ||
|
||
it(`Should return false if is not on included `, () => { | ||
expect(checkChunk(regular, [excluded], ['node_modules'])).toBe(false); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.