{
  "tempDir": true,
  "tests": {
    // a removed direct dependency that remains in the resolution as a
    // transitive dependency should no longer be linked at the root of
    // node_modules (https://github.com/denoland/deno/issues/35083)
    "remove_direct_dep_that_stays_transitive": {
      "steps": [
        {
          "args": "install",
          "output": "[WILDCARD]"
        },
        {
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.lstatSync(path); return true; } catch { return false; } }; const denoEntries = Array.from(Deno.readDirSync('node_modules/.deno')).filter(e => !e.name.startsWith('.')).map(e => e.name); console.log(JSON.stringify({ binCache: denoEntries.some(e => e.includes('@denotest+bin@1.0.0')), binRoot: exists('node_modules/@denotest/bin'), transitiveBinRoot: exists('node_modules/@denotest/transitive-bin') }));"
          ],
          "output": "{\"binCache\":true,\"binRoot\":true,\"transitiveBinRoot\":true}\n"
        },
        {
          "args": "remove bin",
          "output": "[WILDCARD]"
        },
        // the package must stay in the .deno store (still required by
        // @denotest/transitive-bin), but its root symlink must be removed
        {
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.lstatSync(path); return true; } catch { return false; } }; const denoEntries = Array.from(Deno.readDirSync('node_modules/.deno')).filter(e => !e.name.startsWith('.')).map(e => e.name); console.log(JSON.stringify({ binCache: denoEntries.some(e => e.includes('@denotest+bin@1.0.0')), binRoot: exists('node_modules/@denotest/bin'), transitiveBinRoot: exists('node_modules/@denotest/transitive-bin') }));"
          ],
          "output": "{\"binCache\":true,\"binRoot\":false,\"transitiveBinRoot\":true}\n"
        },
        // re-adding the package must restore the root symlink
        {
          "args": "add npm:@denotest/bin@1.0.0",
          "output": "[WILDCARD]"
        },
        {
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.lstatSync(path); return true; } catch { return false; } }; console.log(JSON.stringify({ binRoot: exists('node_modules/@denotest/bin') }));"
          ],
          "output": "{\"binRoot\":true}\n"
        }
      ]
    }
  }
}
