Skip to content

Commit

Permalink
BREAKING CHANGE: Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeSimoes committed Oct 18, 2023
1 parent 3dfb7d4 commit 895b7a3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion utils/__snapshots__/linterError.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports[`Test utils/linterError.js Check formating of a error send to console log 1`] = `
"[utils/linterError.js] ✖ 
my error
[2mLintError at linterError.test.js:12:10
[2mLintError at /Users/felipesimoes/henkel/heliux/fe-build/utils/linterError.test.js:12:10
"
`;
29 changes: 29 additions & 0 deletions utils/checkChunk.test.js
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);
});
});
31 changes: 0 additions & 31 deletions utils/moduleIsVendor.test.js

This file was deleted.

0 comments on commit 895b7a3

Please sign in to comment.