Skip to content

Commit 9c4ce68

Browse files
Altrim Beqiriagilgur5
andcommitted
test: ensure lodash-es replacement is done properly
- lodash for CJS, lodash-es for ESM - previously, there were no tests for this behavior, so this adds them to ensure the replacement continues to work, even with the new fix with regex lookahead for `lodash/fp` Co-authored-by: Anton Gilgur <agilgur5@gmail.com>
1 parent 8b91c74 commit 9c4ce68

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/e2e/tsdx-build-default.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ describe('tsdx build :: zero-config defaults', () => {
6767
expect(matched).toBeFalsy();
6868
});
6969

70+
it('should use lodash for the CJS build', () => {
71+
const output = execWithCache('node ../dist/index.js build');
72+
expect(output.code).toBe(0);
73+
74+
const matched = grep(/lodash/, ['dist/build-default.cjs.*.js']);
75+
expect(matched).toBeTruthy();
76+
});
77+
78+
it('should use lodash-es for the ESM build', () => {
79+
const output = execWithCache('node ../dist/index.js build');
80+
expect(output.code).toBe(0);
81+
82+
const matched = grep(/lodash-es/, ['dist/build-default.esm.js']);
83+
expect(matched).toBeTruthy();
84+
});
85+
7086
it("shouldn't replace lodash/fp", () => {
7187
const output = execWithCache('node ../dist/index.js build');
7288
expect(output.code).toBe(0);

0 commit comments

Comments
 (0)