import { test } from 'ava'

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

import { Config, log } from '../'

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

Config.isDocker && test('Docker smoking test', function(t) {
  // const n = execSync('ps a | grep Xvfb | grep -v grep | wc -l').toString().replace(/\n/, '', 'g')
  // t.is(parseInt(n), 1, 'should has Xvfb started')
  t.notThrows(_ => {
    fs.accessSync(Config.BINARY_CHROMIUM, fs.F_OK)
  }, 'should exist xvfb-chrome exectable')
})

@@ -125,18 +125,148 @@
 '../'%0A%0A/
-/ 
+**%0A * need keep this !Config.isDocker because ava need at least one test() inside.%0A *   %C3%97 No tests found in test%5Cdocker.spec.js%0A */%0A
 !Config.
@@ -319,19 +319,16 @@
 on(t) %7B%0A
-// 
   t.pass
@@ -346,33 +346,89 @@
 cker
-, skip docker tests')%0A// 
+. this test is to prevent AVA %60%C3%97 No tests found in test%5Cdocker.spec.js%60 error.')%0A
 %7D)%0A%0A
@@ -712,9 +712,9 @@
  fs.
-F
+X
 _OK)

test executable in docker