import { test } from 'ava'

import { execSync } from 'child_process'
import sinon from 'sinon'

import { log } from '../'

const docker = !!process.env.WECHATY_DOCKER

!docker && test('Docker test skipped', function(t) {
    t.pass('not in docker, skip docker tests')
})

docker && test('Docker smoking test', function(t) {
  const n = execSync('ps | grep Xvfb | wc -l')
  t.is(n, 1, 'should has Xvfb started')
})

@@ -342,16 +342,18 @@
 ync('ps 
+a 
 %7C grep X
@@ -362,14 +362,40 @@
 b %7C 
-wc -l'
+grep -v grep %7C wc -l').toString(
 )%0A  

fix xvfb counting script