const fs = require('fs')
const path = require('path')
const exec = require('child_process').exec
const tree = require('strong-npm-ls')
const test = require('tap').test
const bin = path.join(__dirname, '..', 'bin', 'dep.js')
const fixtures = fs.readdirSync(path.join(__dirname, 'deps'))
  .filter((name) => { return name !== 'dat' })

test((t) => {
  var items = 3
  var count = fixtures.length * items
  t.plan(count)
  fixtures.forEach(fixture => {
    const pkg = path.join(__dirname, 'deps', fixture)
    const pkgJSON = require(path.join(pkg, 'package.json'))
    exec(`node ${bin} install`, {cwd: pkg}, (err, stdout, stderr) => {
      t.ifError(err, `${pkgJSON.name}: install ran without error`)
      tree.read(pkg, (err, out) => {
        t.ifError(err, `${pkgJSON.name}: tree could be read`)
        const deps = out.dependencies
        t.ok(Object.keys(deps).length, `${pkgJSON.name}: deps are installed`)
        if (count === 0) t.end()
      })
    })
  })
})

@@ -161,16 +161,77 @@
 ').test%0A
+const skip = %5B%0A  'dat',%0A  'install-only',%0A  'install-save'%0A%5D%0A
 const bi
@@ -365,16 +365,20 @@
 =%3E %7B
+%0A   
  return 
 name
@@ -377,22 +377,35 @@
 urn 
-name !== 'dat'
+skip.indexOf(name) === -1%0A 
  %7D)%0A

update directory tree in tests