Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fix(schema): allow name to be a {Function} (options.name) (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-ciniawsky authored and joshwiens committed Oct 5, 2017
1 parent bc73688 commit fbfb160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/options.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"name": {},
"regExp": {},
"context": {
"type": "string"
Expand Down
5 changes: 4 additions & 1 deletion test/Errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import loader from '../src';

describe('Errors', () => {
test('Validation Error', () => {
const err = () => loader.call({ query: { name: 1 }, emitFile: true });
const err = () => loader.call({
query: { useRelativePath: 1 },
emitFile: true,
});

expect(err).toThrow();
expect(err).toThrowErrorMatchingSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/Errors.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ exports[`Errors Validation Error 1`] = `
File Loader Invalid Options
options.name should be string
options.useRelativePath should be boolean
"
`;

0 comments on commit fbfb160

Please sign in to comment.