File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ var OP_READ = 'read',
59
59
Fetcher . getFetcher = function ( name ) {
60
60
//Access fetcher by name
61
61
if ( ! name || ! Fetcher . fetchers [ name ] ) {
62
- throw new Error ( 'Fetcher could not be found' ) ;
62
+ throw new Error ( 'Fetcher "' + name + '" could not be found') ;
63
63
}
64
64
return Fetcher . fetchers [ name ] ;
65
65
} ;
Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ var expect = chai.expect,
21
21
describe ( 'Server Fetcher' , function ( ) {
22
22
23
23
it ( 'should register fetchers' , function ( ) {
24
- var fn = Fetcher . getFetcher . bind ( fetcher , mockFetcher . name ) ;
24
+ var fn = Fetcher . getFetcher . bind ( fetcher ) ;
25
+ expect ( fn ) . to . throw ( Error , 'Fetcher "undefined" could not be found' ) ;
26
+ fn = Fetcher . getFetcher . bind ( fetcher , mockFetcher . name ) ;
25
27
expect ( _ . size ( Fetcher . fetchers ) ) . to . equal ( 0 ) ;
26
- expect ( fn ) . to . throw ( Error , 'Fetcher could not be found' ) ;
28
+ expect ( fn ) . to . throw ( Error , 'Fetcher "' + mockFetcher . name + '" could not be found') ;
27
29
Fetcher . registerFetcher ( mockFetcher ) ;
28
30
expect ( _ . size ( Fetcher . fetchers ) ) . to . equal ( 1 ) ;
29
31
expect ( fn ( ) ) . to . deep . equal ( mockFetcher ) ;
You can’t perform that action at this time.
0 commit comments