Midnight MarketingDocs

Verifying a change#

Confirm a change is publishable before it reaches production. The site has two commands, and the second one is a real gate rather than a smoke test.

Before you start#

Dependencies installed. No running production deployment is required — the verification builds and serves the site locally.

Run the checks#

  1. Lint the source:

    npm run lint
  2. Build and test:

    npm test

    This performs a production build and then exercises the built site. It is slower than a unit-test run, and that is the point: it checks the artefact you are about to deploy rather than the source you are about to build.

What the test actually checks#

Area Assertion
Rendering The page responds 200 with an HTML content type and server-rendered markup
Title The exact document title
Copy Named product claims are present, including the three-command workflow, the topology and staged-changes section, project administration, preview environments, and the editions
Canonical URL The canonical apex URL appears in the document
Structured data A JSON-LD block is present
Retired claims Specific withdrawn claims are absent
Scaffolding Template placeholder text is absent
Headers Content Security Policy with frame-ancestors 'none', plus X-Content-Type-Options, X-Frame-Options, Referrer-Policy and Strict-Transport-Security
Redirect The www hostname returns 308 to the canonical HTTPS apex

Verify#

Both commands exit zero. A passing npm test means the built site renders the expected content, sets every baseline security header, and redirects the www hostname correctly.

If it does not work#

Symptom Check Recovery
Assertion names a missing phrase Whether you edited or removed that copy Restore the claim, or change copy and assertion together
Assertion names a forbidden phrase Whether you reintroduced a retired claim Remove it; see Editing page content
A header assertion fails Whether the worker still sets it See Response headers
The redirect assertion fails Whether the hostname comparison changed See Domains and redirects
The build fails before any assertion The build output for a type or import error Fix the build first; the assertions never ran
Warning

Do not deploy on a failing npm test. The assertions cover the security headers and the canonical redirect, so a failure can mean the published site would lose a protection rather than only a line of copy.