{
  "tempDir": true,
  "tests": {
    "infers_indent_size": {
      // .editorconfig sets indent_size=4. The file is already formatted with
      // 4-space indentation, so `fmt --check` should pass.
      "args": "fmt --check indent_size_4.ts",
      "output": "Checked 1 file\n"
    },
    "infers_indent_size_negative": {
      // Without reading editorconfig, deno's default 2-space indent would
      // refuse the file. With editorconfig support, --indent-width=2 on the
      // CLI overrides the editorconfig value, so check still fails.
      "args": "fmt --check --indent-width=2 indent_size_4.ts",
      "output": "[WILDCARD]Found 1 not formatted file in 1 file\n",
      "exitCode": 1
    },
    "infers_use_tabs": {
      // .editorconfig in tabs/ sets indent_style=tab.
      "args": "fmt --check tabs/file.ts",
      "output": "Checked 1 file\n"
    },
    "infers_max_line_length": {
      // .editorconfig in long_lines/ sets max_line_length=200, allowing a
      // long line that would otherwise exceed deno's default 80.
      "args": "fmt --check long_lines/file.ts",
      "output": "Checked 1 file\n"
    },
    "deno_json_takes_precedence": {
      // deno.json explicitly sets indentWidth=2; editorconfig must NOT override.
      "args": "fmt --check --config with_deno_json/deno.json with_deno_json/file.ts",
      "output": "Checked 1 file\n"
    },
    "nested_overrides_parent": {
      // nested/.editorconfig (root=true) sets indent_size=4; the nearer
      // nested/sub/.editorconfig (not root) sets indent_size=8 and must win.
      // This exercises the walk-up across a non-root file and the
      // nearer-overrides-farther merge order.
      "args": "fmt --check nested/sub/file.ts",
      "output": "Checked 1 file\n"
    },
    "no_editorconfig_flag_opts_out": {
      // --no-editorconfig disables reading .editorconfig, so the root
      // .editorconfig (indent_size=4) is ignored and deno's default 2-space
      // indent applies. The 4-space file then fails --check. (Without the
      // flag this same invocation passes; see infers_indent_size.)
      "args": "fmt --check --no-editorconfig indent_size_4.ts",
      "output": "[WILDCARD]Found 1 not formatted file in 1 file\n",
      "exitCode": 1
    },
    "deno_json_use_editor_config_false_opts_out": {
      // "fmt": { "useEditorConfig": false } in deno.json disables reading
      // .editorconfig, so the indent_size=4 setting is ignored and the
      // 4-space file fails deno's default 2-space check.
      "args": "fmt --check --config opt_out/deno.json opt_out/file.ts",
      "output": "[WILDCARD]Found 1 not formatted file in 1 file\n",
      "exitCode": 1
    },
    "logs_at_debug": {
      // With -L debug, fmt notes that it found and is using the .editorconfig.
      "args": "fmt --check -L debug indent_size_4.ts",
      "output": "[WILDCARD]Found .editorconfig at [WILDLINE].editorconfig and using it[WILDCARD]Checked 1 file[WILDCARD]"
    },
    "cache_invalidated_on_editorconfig_change": {
      // The incremental cache folds the .editorconfig-resolved options into
      // its per-file hash. Editing .editorconfig must invalidate the cached
      // "already formatted" result even though the file body is unchanged,
      // so a later --check re-evaluates the file instead of returning a
      // stale pass. file.ts is indented with 4 spaces.
      "steps": [
        {
          // indent_size=4 matches the file, so --check passes and records it
          // as formatted in the incremental cache.
          "args": "fmt --check cache_invalidation/file.ts",
          "output": "Checked 1 file\n"
        },
        {
          // Flip the .editorconfig to indent_size=2 without touching file.ts.
          "args": [
            "eval",
            "Deno.writeTextFileSync('cache_invalidation/.editorconfig', 'root = true\\n[*.ts]\\nindent_size = 2\\n')"
          ],
          "output": ""
        },
        {
          // If the cache ignored .editorconfig it would return the stale pass;
          // instead the folded hash changed, so the 4-space file is
          // re-evaluated and fails the 2-space check.
          "args": "fmt --check cache_invalidation/file.ts",
          "output": "[WILDCARD]Found 1 not formatted file in 1 file\n",
          "exitCode": 1
        }
      ]
    }
  }
}
