@@ -12,11 +12,52 @@ chai.use(require("chai-as-promised"));
1212describe ( "pokedex" , function ( ) {
1313 var promise ,
1414 id = 2 ,
15+ path = '/api/v2/pokemon/34' ,
16+ url = 'https://pokeapi.co/api/v2/pokemon/35' ,
1517 P = new Pokedex . Pokedex ( )
16- secureP = new Pokedex . Pokedex ( { protocol : 'https' } ) ;
18+ secureP = new Pokedex . Pokedex ( { protocol : 'https' } ) ;
1719
1820 this . timeout ( 21000 ) ;
1921
22+ describe ( ".resource(Mixed: array)" , function ( ) {
23+ before ( function ( ) {
24+ promise = P . resource ( [ '/api/v2/pokemon/36' , 'api/v2/berry/8' , 'https://pokeapi.co/api/v2/ability/9/' ] ) ;
25+ } ) ;
26+ it ( "should succeed" , function ( ) {
27+ return promise ;
28+ } ) ;
29+ it ( "should have length 3" , function ( ) {
30+ return expect ( promise ) . to . eventually . have . length ( 3 ) ;
31+ } ) ;
32+ it ( "should have property name" , function ( ) {
33+ return expect ( promise ) . to . eventually . all . have . property ( 'name' ) ;
34+ } ) ;
35+ } ) ;
36+
37+ describe ( ".resource(Path: string)" , function ( ) {
38+ before ( function ( ) {
39+ promise = P . resource ( path ) ;
40+ } ) ;
41+ it ( "should succeed" , function ( ) {
42+ return promise ;
43+ } ) ;
44+ it ( "should have property height" , function ( ) {
45+ return expect ( promise ) . to . eventually . have . property ( 'height' ) ;
46+ } ) ;
47+ } ) ;
48+
49+ describe ( ".resource(Url: string)" , function ( ) {
50+ before ( function ( ) {
51+ promise = P . resource ( url ) ;
52+ } ) ;
53+ it ( "should succeed" , function ( ) {
54+ return promise ;
55+ } ) ;
56+ it ( "should have property height" , function ( ) {
57+ return expect ( promise ) . to . eventually . have . property ( 'height' )
58+ } ) ;
59+ } ) ;
60+
2061 describe ( ".getVersionByName(Id: int)" , function ( ) {
2162 before ( function ( ) {
2263 promise = P . getVersionByName ( id ) ;
@@ -25,7 +66,7 @@ describe("pokedex", function () {
2566 return promise ;
2667 } ) ;
2768 it ( "should have property name" , function ( ) {
28- return expect ( P . getVersionByName ( id ) ) . to . eventually . have . property ( "name" ) ;
69+ return expect ( promise ) . to . eventually . have . property ( "name" ) ;
2970 } ) ;
3071 } ) ;
3172
0 commit comments