// Tests that `deno install` creates a `node_modules` directory inside each
// workspace member, containing that member's direct dependencies, links to
// sibling workspace members, and a `.bin` populated with the member's
// dependencies' executables, matching the npm/pnpm workspace layout. It also
// checks that dropping a member's dependency and reinstalling prunes the now
// stale link, and the now stale `.bin` entry, so they no longer resolve from
// the member. This is checked for both the isolated (default) and hoisted
// linker modes.
//
// https://github.com/denoland/deno/issues/26743
// https://github.com/denoland/deno/issues/27550
{
  "tempDir": true,
  "tests": {
    "isolated": {
      "steps": [
        {
          "args": "install",
          "output": "install.out"
        },
        {
          "args": "run --allow-read check.ts",
          "output": "check.out"
        },
        {
          "args": "run --allow-read --allow-write drop_deps.ts",
          "output": "dropped\n"
        },
        {
          "args": "install",
          "output": "[WILDCARD]"
        },
        {
          "args": "run --allow-read check_pruned.ts",
          "output": "check_pruned.out"
        }
      ]
    },
    "hoisted": {
      "steps": [
        {
          "args": "install --node-modules-dir=manual --node-modules-linker=hoisted",
          "output": "[WILDCARD]"
        },
        {
          "args": "run --allow-read check.ts",
          "output": "check.out"
        },
        {
          "args": "run --allow-read --allow-write drop_deps.ts",
          "output": "dropped\n"
        },
        {
          "args": "install --node-modules-dir=manual --node-modules-linker=hoisted",
          "output": "[WILDCARD]"
        },
        {
          "args": "run --allow-read check_pruned.ts",
          "output": "check_pruned.out"
        }
      ]
    }
  }
}
