tsconfig.test.node.json

// Node-flavoured half of the test typecheck (#337): the tests that exercise
// main, preload, shared and the verifier CLI. Mirrors tsconfig.node.json's libs
// so `fetch`/`Buffer`/timers resolve to the Node typings the code under test
// actually runs against — pulling DOM in here masks real errors (undici's
// Response.json() returns unknown, the DOM's returns any) and invents fake ones
// (BodyInit rejects a Buffer).
//
// Fail-closed: everything under tests/ is in by default and the DOM-flavoured
// directories are excluded, so a new test directory lands in a project rather
// than in neither. .tsx is claimed by tsconfig.test.web.json wherever it sits.
// The include lists every non-JSX extension tsc compiles (.ts/.mts/.cts, and
// so their .d.* forms) rather than .ts alone, or a stray .mts would be in no
// project and its errors would never be reported.
//
// The exclude list is hand-maintained and only one direction of it is safe. A
// new DOM-flavoured directory of .ts files (say tests/views/) defaults in here
// without the DOM lib and errors on `document` — an error that points at the
// symbol rather than at the project boundary. Moving one means editing this
// exclude and tsconfig.test.web.json's include together.
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "composite": false,
    "noEmit": true,
    "lib": ["ES2022"],
    "types": ["node", "vitest/globals"],
    "paths": {
      "@main/*": ["./src/main/*"],
      "@shared/*": ["./src/shared/*"]
    }
  },
  "include": ["tests/**/*.ts", "tests/**/*.mts", "tests/**/*.cts"],
  "exclude": [
    "tests/components",
    "tests/extension",
    "tests/hooks",
    "tests/lib",
    "tests/renderer"
  ]
}