Skip to content

🦋 Release package updates - #3014

Merged
AshCorr merged 1 commit into
mainfrom
changeset-release/main
Nov 5, 2026
Merged

AshCorr merged 1 commit into
mainfrom
changeset-release/main

Conversation

@guardian-cdk

@guardian-cdk guardian-cdk Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@guardian/cdk@67.0.0

Major Changes

  • 096dd50: Mock the tracking tag value using NODE_ENV

    When NODE_ENV=test (set automatically by Jest), the gu:cdk:version tracking tag is TEST. Mocking is no longer needed.

    Migration

    1. Delete jest.setup.js.
    2. Remove "./jest.setup.js" from setupFilesAfterEnv in your Jest config (jest.config.js or package.json).
    3. Remove !jest.setup.js from .gitignore, if present.
    4. Ensure tests run with NODE_ENV=test (Jest does this by default), then update your snapshots (npm test -- -u).

    If everything has worked correctly you should not see any change to your snapshots.

Minor Changes

  • 3995734: New projects created with npx @guardian/cdk@latest new now use the built-in Node.js test runner instead of Jest.

    Existing projects are unaffected. To migrate an existing project:

    1. Remove the jest, ts-jest and @types/jest dependencies, the jest block in package.json, and any jest.config.js.

    2. Update the scripts in package.json:

      "test": "NODE_ENV=test node --require ts-node/register --test \"lib/**/*.test.ts\"",
      "test-update": "NODE_ENV=test node --require ts-node/register --test --test-update-snapshots \"lib/**/*.test.ts\""

      NODE_ENV=test must be set, as the Node.js test runner does not set it (unlike Jest). GuCDK uses it to keep the gu:cdk:version tag static in snapshots.

    3. Update your tests to use suite and test from node:test in place of describe and it, and the test context's snapshot assertion in place of toMatchSnapshot:

      import { suite, test } from "node:test";
      
      suite("The MyStack stack", () => {
        test("matches the snapshot", (t) => {
          const app = new App();
          const stack = new MyStack(app, "MyStack", { stack: "my-stack", stage: "TEST" });
          const template = Template.fromStack(stack);
          t.assert.snapshot(template.toJSON());
        });
      });
    4. Delete the old Jest snapshots (lib/__snapshots__) and regenerate them with npm run test-update. Review the diff, as the snapshot file format differs.

    5. In eslint.config.mjs, remove ...guardian.configs.jest and disable @typescript-eslint/no-floating-promises for test files:

      {
        files: ["**/*.test.ts"],
        rules: {
          // node:test's `suite` and `test` return promises that the runner handles
          "@typescript-eslint/no-floating-promises": "off"
        },
      },

Patch Changes

@guardian-cdk
guardian-cdk Bot requested a review from a team as a code owner October 26, 2026 07:51
@guardian-cdk guardian-cdk Bot added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Oct 26, 2026
@guardian-cdk
guardian-cdk Bot force-pushed the changeset-release/main branch from e1dbe6e to ca12dda Compare November 3, 2026 08:38
@guardian-cdk
guardian-cdk Bot force-pushed the changeset-release/main branch from ca12dda to 74e1f1f Compare November 5, 2026 10:35
@AshCorr
AshCorr enabled auto-merge November 5, 2026 10:35
@AshCorr
AshCorr merged commit ad42f90 into main Nov 5, 2026
9 checks passed
@AshCorr
AshCorr deleted the changeset-release/main branch November 5, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant