Skip to content

Commit e2220c4

Browse files
berthertogenmichael-ciniawsky
authored andcommitted
fix(schema): allow the output filename to be a {Function} (#1409)
1 parent 807c846 commit e2220c4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/optionsSchema.json

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
},
3737
{
3838
"type": "string"
39+
},
40+
{
41+
"instanceof": "Function"
3942
}
4043
]
4144
},

test/Validation.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ describe('Validation', () => {
7070
});
7171
});
7272

73+
describe('filename', () => {
74+
it('should allow filename to be a function', () => {
75+
try {
76+
// eslint-disable-next-line no-new
77+
new Server(compiler, { filename: () => {} });
78+
} catch (e) {
79+
if (!(e instanceof OptionsValidationError)) { throw e; }
80+
throw new Error("Validation failed and it shouldn't");
81+
}
82+
});
83+
});
84+
7385
describe('checkHost', () => {
7486
it('should always allow any host if options.disableHostCheck is set', () => {
7587
const options = {

0 commit comments

Comments
 (0)