Skip to content

Commit

Permalink
Updated options schema
Browse files Browse the repository at this point in the history
  • Loading branch information
webdeveric committed Dec 3, 2020
1 parent 4272dd4 commit 5059297
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/options-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"title": "Webpack Assets Manifest options schema",
"description": "Webpack Assets Manifest options",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
Expand Down
15 changes: 13 additions & 2 deletions test/WebpackAssetsManifest-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,17 @@ describe('WebpackAssetsManifest', function() {
);
}).to.throw();
});

it('Error is thrown when options has unknown property', function() {
expect(() => {
create(
configs.hello(),
{
someUnknownProperty: 'will fail',
},
);
}).to.throw();
});
});
});

Expand Down Expand Up @@ -1017,7 +1028,7 @@ describe('WebpackAssetsManifest', function() {
describe('Options', function() {
it('Options can be altered with a hook', function() {
const mock = chai.spy( options => {
options.testing = true;
options.space = 0;

return options;
});
Expand All @@ -1032,7 +1043,7 @@ describe('WebpackAssetsManifest', function() {

expect( mock ).to.have.been.called();

expect( manifest.options.testing ).to.be.true;
expect( manifest.options.space ).to.equal(0);
});
});

Expand Down

0 comments on commit 5059297

Please sign in to comment.