1- 'use strict' ;
1+ 'use strict'
22
3- var PassThrough = require ( 'stream' ) . PassThrough ;
4- var test = require ( 'tape' ) ;
5- var execa = require ( 'execa' ) ;
6- var version = require ( './package.json' ) . version ;
7- var direction = require ( '.' ) ;
3+ var PassThrough = require ( 'stream' ) . PassThrough
4+ var test = require ( 'tape' )
5+ var execa = require ( 'execa' )
6+ var version = require ( './package.json' ) . version
7+ var direction = require ( '.' )
88
99var fixtures = [
1010 { input : '0' , output : 'neutral' } ,
@@ -28,58 +28,52 @@ var fixtures = [
2828 { input : 'الجملة' , output : 'rtl' } ,
2929 { input : 'الانجليزية' , output : 'rtl' } ,
3030 { input : 'بسيطة' , output : 'rtl' }
31- ] ;
31+ ]
3232
33- test ( 'api' , function ( t ) {
34- t . equal (
35- direction ( ) ,
36- 'neutral' ,
37- 'should classify nully as `neutral`'
38- ) ;
33+ test ( 'api' , function ( t ) {
34+ t . equal ( direction ( ) , 'neutral' , 'should classify nully as `neutral`' )
3935
40- fixtures . forEach ( function ( check ) {
36+ fixtures . forEach ( function ( check ) {
4137 t . equal (
4238 direction ( check . input ) ,
4339 check . output ,
4440 'should classify `' + check . input + '` as `' + check . output + '`'
45- ) ;
46- } ) ;
41+ )
42+ } )
4743
48- t . end ( ) ;
49- } ) ;
44+ t . end ( )
45+ } )
5046
51- test ( 'cli' , function ( t ) {
52- var input = new PassThrough ( ) ;
47+ test ( 'cli' , function ( t ) {
48+ var input = new PassThrough ( )
5349
54- t . plan ( 7 ) ;
50+ t . plan ( 7 )
5551
56- execa . stdout ( './cli.js' , [ ' ' , 'abc' ] ) . then ( function ( result ) {
57- t . equal ( result , 'ltr' , 'arguments' ) ;
58- } ) ;
52+ execa . stdout ( './cli.js' , [ ' ' , 'abc' ] ) . then ( function ( result ) {
53+ t . equal ( result , 'ltr' , 'arguments' )
54+ } )
5955
60- execa . stdout ( './cli.js' , [ ' ' , '\t' ] ) . then ( function ( result ) {
61- t . equal ( result , 'neutral' , 'neutral' ) ;
62- } ) ;
56+ execa . stdout ( './cli.js' , [ ' ' , '\t' ] ) . then ( function ( result ) {
57+ t . equal ( result , 'neutral' , 'neutral' )
58+ } )
6359
64- execa . stdout ( './cli.js' , { input : input } ) . then ( function ( result ) {
65- t . equal ( result , 'rtl' , 'stdin' ) ;
66- } ) ;
60+ execa . stdout ( './cli.js' , { input : input } ) . then ( function ( result ) {
61+ t . equal ( result , 'rtl' , 'stdin' )
62+ } )
6763
68- input . write ( 'لة' ) ;
64+ input . write ( 'لة' )
6965
70- setImmediate ( function ( ) {
71- input . end ( 'الجم' ) ;
72- } ) ;
73-
74- [ '-h' , '--help' ] . forEach ( function ( flag ) {
75- execa . stdout ( './cli.js' , [ flag ] ) . then ( function ( result ) {
76- t . ok ( / \s + U s a g e : d i r e c t i o n / . test ( result ) , flag ) ;
77- } ) ;
78- } ) ;
79-
80- [ '-v' , '--version' ] . forEach ( function ( flag ) {
81- execa . stdout ( './cli.js' , [ flag ] ) . then ( function ( result ) {
82- t . equal ( result , version , flag ) ;
83- } ) ;
84- } ) ;
85- } ) ;
66+ setImmediate ( function ( ) {
67+ input . end ( 'الجم' )
68+ } )
69+ ; [ '-h' , '--help' ] . forEach ( function ( flag ) {
70+ execa . stdout ( './cli.js' , [ flag ] ) . then ( function ( result ) {
71+ t . ok ( / \s + U s a g e : d i r e c t i o n / . test ( result ) , flag )
72+ } )
73+ } )
74+ ; [ '-v' , '--version' ] . forEach ( function ( flag ) {
75+ execa . stdout ( './cli.js' , [ flag ] ) . then ( function ( result ) {
76+ t . equal ( result , version , flag )
77+ } )
78+ } )
79+ } )
0 commit comments