hunk.code_window:       id: 'localhost+4873/for-legacy-node/1.0.0',
         name: 'for-legacy-node',
         version: '1.0.0',
       },
       parents: [],
       reason: 'incompatible_engine',
     })
     const reportedTimes = reporter.withArgs(logMatcher).callCount
     t.equal(reportedTimes, 1, 'skipping optional dependency is logged')
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:     reason: 'unsupported_engine',
  
hunk.file_path: test/install/optionalDependencies.ts
hunk.type: replace
file: import path = require('path')
  import rimraf = require('rimraf-then')
  import {install, installPkgs} from 'supi'
  import tape = require('tape')
  import promisifyTape from 'tape-promise'
  import writeJsonFile = require('write-json-file')
  import {prepare, testDefaults} from '../utils'
  
  const test = promisifyTape(tape)
  
  test('repeat install with corrupted `store.json` should work', async (t: tape.Test) => {
    const project = prepare(t)
  
    const opts = await testDefaults()
    await installPkgs(['is-negative@1.0.0'], opts)
  
    await rimraf('node_modules')
  
    // When a package reference is missing from `store.json`
    // we assume that it is not in the store.
    // The package is downloaded and in case there is a folder
    // in the store, it is overwritten.
    await writeJsonFile(path.join(opts.store, '2', 'store.json'), {})
  
    await install(opts)
  
    const m = project.requireModule('is-negative')
    t.ok(m)
  })
  