1515 */
1616import * as should from 'should'
1717
18- import { NodeApi } from '../src/node '
18+ import { Api } from '../'
1919
2020describe ( 'Create new instance for API' , function ( ) {
2121 it ( 'should have methods' , function ( ) {
22- const api = new NodeApi ( { url : 'http://localhost' } )
22+ const api = new Api ( { url : 'http://localhost' } )
2323 should ( api . copy ) . be . a . Function ( ) . and . has . lengthOf ( 5 )
2424 should ( api . count ) . be . a . Function ( ) . and . has . lengthOf ( 2 )
2525 should ( api . create ) . be . a . Function ( ) . and . has . lengthOf ( 3 )
@@ -41,17 +41,17 @@ describe('Create new instance for API', function () {
4141 } )
4242
4343 it ( 'should set correct API path based on passed configuration (version is passed)' , function ( ) {
44- const api = new NodeApi ( { url : 'http://localhost' , version : '2.0' } )
44+ const api = new Api ( { url : 'http://localhost' , version : '2.0' } )
4545 should ( api . _httpOptions . path ) . equal ( '/attask/api/v2.0' )
4646 } )
4747
4848 it ( 'should set correct API path based on passed configuration (version is not passed)' , function ( ) {
49- const api = new NodeApi ( { url : 'http://localhost' } )
49+ const api = new Api ( { url : 'http://localhost' } )
5050 should ( api . _httpOptions . path ) . equal ( '/attask/api-internal' )
5151 } )
5252
5353 it ( 'should set correct API path based on passed configuration (version="asp")' , function ( ) {
54- const api = new NodeApi ( { url : 'http://localhost' , version : 'asp' } )
54+ const api = new Api ( { url : 'http://localhost' , version : 'asp' } )
5555 should ( api . _httpOptions . path ) . equal ( '/attask/api-asp' )
5656 } )
5757} )
0 commit comments