8000 Add case `overrides` tests. · lodash/lodash-webpack-plugin@d9fddfe · GitHub
[go: up one dir, main page]

Skip to 8000 content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit d9fddfe

Browse files
committed
Add case overrides tests.
1 parent dac2fcd commit d9fddfe

File tree

7 files changed

+36
-0
lines changed

7 files changed

+36
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { camelCase } from 'lodash';
2+
3+
camelCase('a b');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { kebabCase } from 'lodash';
2+
3+
kebabCase('a b');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { toLower } from 'lodash';
2+
3+
toLower('aB');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { snakeCase } from 'lodash';
2+
3+
snakeCase('a b');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { startCase } from 'lodash';
2+
3+
startCase('a b');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { toUpper } from 'lodash';
2+
3+
toUpper('aB');

test/index.js

Lines changed: 18 additions 8000 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,24 @@ describe('reduced modular builds', function() {
9595

9696
/*--------------------------------------------------------------------------*/
9797

98+
_.each(glob.sync(path.join(__dirname, 'case-fixtures/*/')), testPath => {
99+
const testName = getTestName(testPath);
100+
const actualPath = path.join(testPath, 'actual.js');
101+
const config = new Config(actualPath);
102+
const plugin = config.plugins[0];
103+
104+
it(`should enable unicode for explicit \`${ testName }\` use`, done => {
105+
new Compiler(config).run()
106+
.then(() => {
107+
assert.ok(!_.some(plugin.matches, pair => _.endsWith(pair[0], '_unicodeWords.js')));
108+
done();
109+
})
110+
.catch(done);
111+
});
112+
});
113+
114+
/*--------------------------------------------------------------------------*/
115+
98116
_.each(glob.sync(path.join(__dirname, 'clone-fixtures/*/')), testPath => {
99117
const testName = getTestName(testPath);
100118
const actualPath = path.join(testPath, 'actual.js');

0 commit comments

Comments
 (0)
0