-
Notifications
You must be signed in to change notification settings - Fork 11
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
d9ca1c5
commit 2af795f
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
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,15 @@ | ||
import createOutput from '../lib/createOutput'; | ||
import normalBuildOption from './util/buildOption.normal'; | ||
import normalComponents from './util/components.normal'; | ||
|
||
|
||
describe('test createOutput', function(){ | ||
it('should pass', function(){ | ||
const res = createOutput(normalComponents, normalBuildOption); | ||
expect(res).toMatch(/require\('.*'\)/); | ||
}); | ||
|
||
it('should throw error when pass in a bad Array', function(){ | ||
expect(()=>createOutput('NOT AN ARRAY', normalBuildOption)).toThrow('[webpack-component-loader]: the component is not an array'); | ||
}) | ||
}) |
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,31 @@ | ||
export default | ||
[ | ||
{ | ||
"root": "", | ||
"dir": "include", | ||
"base": "componentA.tpl", | ||
"ext": ".tpl", | ||
"name": "componentA" | ||
}, | ||
{ | ||
"root": "", | ||
"dir": "include", | ||
"base": "componentD.tpl", | ||
"ext": ".tpl", | ||
"name": "componentD" | ||
}, | ||
{ | ||
"root": "", | ||
"dir": "", | ||
"base": "componentB.tpl", | ||
"ext": ".tpl", | ||
"name": "componentB" | ||
}, | ||
{ | ||
"root": "/", | ||
"dir": "", | ||
"base": "pageC.tpl", | ||
"ext": ".tpl", | ||
"name": "pageC" | ||
} | ||
]; |