import { expect } from 'chai' ; import { createAskSdkError , createAskSdkUserAgent } from '../../lib/util/AskSdkUtils' ; describe ( 'AskSdkUtils' , ( ) => { it ( 'should be able to create custom error' , ( ) => { const error = createAskSdkError ( 'Custom name' , 'Custom message' ) ; expect ( error . name ) . equal ( 'AskSdk.Custom name Error' ) ; expect ( error . message ) . equal ( 'Custom message' ) ; } ) ; it ( 'should be able to create user agent string' , ( ) => { const userAgent = createAskSdkUserAgent ( '2.0.0' , undefined ) ; expect ( userAgent ) . equal ( `ask-node/2.0.0 Node/${ process . version }` ) ; } ) ; it ( 'should be able to create user agent string with custom user agent' , ( ) => { const userAgent = createAskSdkUserAgent ( '2.0.0' , 'custom user agent' ) ; const packageInfo = require ( '../../package.json' ) ; expect ( userAgent ) . equal ( `ask-node/2.0.0 Node/${ process . version } custom user agent` ) ; } ) ; } ) ;