This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39016b8
commit 696ca77
Showing
8 changed files
with
2,851 additions
and
459 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"regExp": {}, | ||
"context": { | ||
"type": "string" | ||
}, | ||
"publicPath": {}, | ||
"outputPath": {}, | ||
"useRelativePath": { | ||
"type": "boolean" | ||
}, | ||
"emitFile": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import loader from '../src'; | ||
|
||
describe('Errors', () => { | ||
test('Validation Error', () => { | ||
const err = () => loader.call({ query: { name: 1 }, emitFile: true }); | ||
|
||
expect(err).toThrow(); | ||
expect(err).toThrowErrorMatchingSnapshot(); | ||
}); | ||
|
||
test('Loader Error', () => { | ||
const err = () => loader.call({ emitFile: false }); | ||
|
||
expect(err).toThrow(); | ||
expect(err).toThrowErrorMatchingSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Errors Loader Error 1`] = ` | ||
"File Loader | ||
emitFile is required from module system" | ||
`; | ||
|
||
exports[`Errors Validation Error 1`] = ` | ||
"Validation Error | ||
File Loader Invalid Options | ||
options.name should be string | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters