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

Commit fbfb160

Browse files
michael-ciniawskyjoshwiens
authored andcommittedOct 5, 2017
fix(schema): allow name to be a {Function} (options.name) (#216)
1 parent bc73688 commit fbfb160

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed
 

‎src/options.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"type": "object",
33
"properties": {
4-
"name": {
5-
"type": "string"
6-
},
4+
"name": {},
75
"regExp": {},
86
"context": {
97
"type": "string"

‎test/Errors.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import loader from '../src';
22

33
describe('Errors', () => {
44
test('Validation Error', () => {
5-
const err = () => loader.call({ query: { name: 1 }, emitFile: true });
5+
const err = () => loader.call({
6+
query: { useRelativePath: 1 },
7+
emitFile: true,
8+
});
69

710
expect(err).toThrow();
811
expect(err).toThrowErrorMatchingSnapshot();

‎test/__snapshots__/Errors.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ exports[`Errors Validation Error 1`] = `
1111
1212
File Loader Invalid Options
1313
14-
options.name should be string
14+
options.useRelativePath should be boolean
1515
"
1616
`;

0 commit comments

Comments
 (0)
This repository has been archived.