Skip to content

Commit

Permalink
fix(schema): allow the output filename to be a {Function} (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
berthertogen authored and michael-ciniawsky committed Aug 22, 2018
1 parent 807c846 commit e2220c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/optionsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
},
{
"type": "string"
},
{
"instanceof": "Function"
}
]
},
Expand Down
12 changes: 12 additions & 0 deletions test/Validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ describe('Validation', () => {
});
});

describe('filename', () => {
it('should allow filename to be a function', () => {
try {
// eslint-disable-next-line no-new
new Server(compiler, { filename: () => {} });
} catch (e) {
if (!(e instanceof OptionsValidationError)) { throw e; }
throw new Error("Validation failed and it shouldn't");
}
});
});

describe('checkHost', () => {
it('should always allow any host if options.disableHostCheck is set', () => {
const options = {
Expand Down

0 comments on commit e2220c4

Please sign in to comment.