File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,11 @@ function k() {
15
15
return execa ( 'eval' , args , { shell : '/bin/zsh' } ) . then ( ( { stdout} ) => stdout ) ;
16
16
}
17
17
18
- k . stripColors = function ( ) {
19
- return k . apply ( undefined , arguments )
20
- . then ( stdout => stripAnsi ( stdout ) ) ;
18
+ k . stripColors = function ( stdout ) {
19
+ return stripAnsi ( stdout ) ;
21
20
}
22
21
23
- k . split = function splitToArray ( stdout ) {
22
+ k . split = function ( stdout ) {
24
23
return stdout . split ( / \s ? \n / ) ;
25
24
}
26
25
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
- import { default as k , split } from './helpers/run-k-in-javascript' ;
2
+ import { default as k , split , stripColors } from './helpers/run-k-in-javascript' ;
3
3
4
4
test ( 'File and directory types' , async t => {
5
- const lines = await k . stripColors ( 'fixtures/one' ) . then ( split ) ;
5
+ const lines = await k ( 'fixtures/one' ) . then ( stripColors ) . then ( split ) ;
6
6
t . is ( lines [ 0 ] , 'total 16' ) ;
7
7
t . is ( lines [ 1 ] , '-rwxr-sr-x 1 supercrabtree staff 0 10 Feb 20:19 | exe-with-gid' ) ;
8
8
t . is ( lines [ 2 ] , '-rwsr-sr-x 1 supercrabtree staff 0 10 Feb 20:42 | exe-with-gid-and-uid' ) ;
You can’t perform that action at this time.
0 commit comments