{
  "tempDir": true,
  "tests": {
    "remove_cleans_hoisted_node_modules": {
      "steps": [
        {
          "args": "install",
          "output": "[WILDCARD]"
        },
        {
          // hoisted layout: packages live directly in node_modules, the scoped
          // package under a node_modules/@denotest scope directory
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.statSync(path); return true; } catch { return false; } }; console.log(JSON.stringify({ chalk: exists('node_modules/chalk'), add: exists('node_modules/@denotest/add'), scope: exists('node_modules/@denotest') }));"
          ],
          "output": "{\"chalk\":true,\"add\":true,\"scope\":true}\n"
        },
        {
          // removing the scoped package must delete it and prune the now-empty
          // @denotest scope directory, leaving chalk untouched
          "args": "remove add",
          "output": "[WILDCARD]"
        },
        {
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.statSync(path); return true; } catch { return false; } }; console.log(JSON.stringify({ chalk: exists('node_modules/chalk'), add: exists('node_modules/@denotest/add'), scope: exists('node_modules/@denotest') }));"
          ],
          "output": "{\"chalk\":true,\"add\":false,\"scope\":false}\n"
        },
        {
          // removing the last package cleans up the remaining hoisted entry and
          // empties the config + lock
          "args": "remove chalk",
          "output": "[WILDCARD]"
        },
        {
          "args": [
            "eval",
            "const exists = (path) => { try { Deno.statSync(path); return true; } catch { return false; } }; const config = JSON.parse(Deno.readTextFileSync('deno.json')); const lock = JSON.parse(Deno.readTextFileSync('deno.lock')); console.log(JSON.stringify({ chalk: exists('node_modules/chalk'), add: exists('node_modules/@denotest/add'), scope: exists('node_modules/@denotest'), imports: config.imports ?? null, npm: lock.npm ?? null }));"
          ],
          "output": "{\"chalk\":false,\"add\":false,\"scope\":false,\"imports\":null,\"npm\":null}\n"
        }
      ]
    }
  }
}
