docs: correct stale no-op comments in node test setup
setup/node.ts installs the no-instrumentation guard (vi.mock against real Sentry/OTel SDK init) via its import — it was never a no-op. Fix the same lie in core-typescript's jsdom base-config test comments and test title. (S2) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import "./no-instrumentation";
|
||||
|
||||
// Reserved for future global node-env setup. Currently a no-op so that
|
||||
// vitest configs may reference @repo/core-testing/setup/node uniformly.
|
||||
// Applies the no-instrumentation guard (vi.mock against real Sentry/OTel SDK
|
||||
// init) via the import above; otherwise reserved for future global node-env
|
||||
// setup so vitest configs may reference @repo/core-testing/setup/node uniformly.
|
||||
export {};
|
||||
|
||||
@@ -3,7 +3,8 @@ import { jsdomVitestConfig } from "./vitest.base.jsdom";
|
||||
|
||||
// jsdomVitestConfig is built with mergeConfig(nodeVitestConfig, ...).
|
||||
// mergeConfig concatenates arrays rather than replacing them, so:
|
||||
// - setupFiles inherits the node setup file (currently a no-op) AND adds the jsdom one
|
||||
// - setupFiles inherits the node setup file (which applies the
|
||||
// no-instrumentation guard) AND adds the jsdom one
|
||||
// - include inherits the node patterns AND adds the tsx-aware patterns (the file globs deduplicate at resolution)
|
||||
// We assert the EXACT merged arrays so any future change to setup/node.ts or to include
|
||||
// behavior is consciously visible in this test.
|
||||
@@ -12,7 +13,7 @@ describe("jsdomVitestConfig", () => {
|
||||
it("uses jsdom environment", () => {
|
||||
expect(jsdomVitestConfig.test?.environment).toBe("jsdom");
|
||||
});
|
||||
it("loads both the node setup (no-op) and jsdom setup files", () => {
|
||||
it("loads both the node setup (no-instrumentation guard) and jsdom setup files", () => {
|
||||
expect(jsdomVitestConfig.test?.setupFiles).toEqual([
|
||||
"@repo/core-testing/setup/node",
|
||||
"@repo/core-testing/setup/jsdom",
|
||||
|
||||
Reference in New Issue
Block a user