Skip to content

Commit

Permalink
test(options): add test for functions option as function
Browse files Browse the repository at this point in the history
Adds a test for the case where the functions option is supplied as a function. Passes the Loader Context and also checks that it is available.
  • Loading branch information
lunelson committed Dec 16, 2018
1 parent be625d2 commit fc6c195
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/index.test.js
Expand Up @@ -190,6 +190,13 @@ implementations.forEach((implementation) => {
execTest('custom-functions', {
functions: customFunctions(implementation),
}));
it('should expose custom functions if the option is a function', () =>
execTest('custom-functions', {
functions: (loaderContext) => {
should.exist(loaderContext);
return customFunctions(implementation);
},
}));
});
describe('prepending data', () => {
it('should extend the data option if present and it is string', () =>
Expand Down

0 comments on commit fc6c195

Please sign in to comment.