@@ -2,6 +2,7 @@ import * as Utils from '../lib/utils';
2
2
import { createFakeEditor } from './helpers' ;
3
3
import { expect } from 'chai' ;
4
4
import { Point } from 'atom' ;
5
+ import { join , dirname } from 'path'
5
6
6
7
describe ( 'Utils' , ( ) => {
7
8
describe ( 'getWordAtPosition' , ( ) => {
@@ -30,4 +31,23 @@ describe('Utils', () => {
30
31
expect ( range . serialize ( ) ) . eql ( [ [ 0 , 4 ] , [ 0 , 4 ] ] ) ;
31
32
} ) ;
32
33
} ) ;
34
+
35
+ describe ( 'getExePath' , ( ) => {
36
+ it ( 'returns the exe path under bin folder by default' , ( ) => {
37
+ const exePath = Utils . getExePath ( 'serve-d' ) ;
38
+ let expectedExe = join ( dirname ( dirname ( __dirname ) ) , 'bin' , process . platform , 'serve-d' ) ;
39
+ if ( process . platform === 'win32' ) {
40
+ expectedExe = expectedExe + '.exe' ;
41
+ }
42
+ expect ( exePath ) . eq ( expectedExe ) ;
43
+ } )
44
+ it ( 'returns the exe path for the given root' , ( ) => {
45
+ const exePath = Utils . getExePath ( 'serve-d' , __dirname ) ;
46
+ let expectedExe = join ( __dirname , process . platform , 'serve-d' ) ;
47
+ if ( process . platform === 'win32' ) {
48
+ expectedExe = expectedExe + '.exe' ;
49
+ }
50
+ expect ( exePath ) . eq ( expectedExe ) ;
51
+ } )
52
+ } )
33
53
} ) ;
0 commit comments