What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
When a shared title template appends a suffix, test the complete title a crawler receives—not just the title entered for an individual page. In the example covered here, the root layout adds | Notifio, a 10-character suffix. A 58-character authored title therefore renders as 68 characters. The test derives the suffix from the layout, checks that the template is still recognizable, and fails if it cannot reliably inspect the metadata.
Why test the rendered title?
A page’s authored title may not be the title ultimately assembled for display. A shared layout can append a site name or other text, so a check against only the page-level value misses those added characters. The implementation described by Daniel Pertu on DEV Community uses the root layout’s title template to append | Notifio. The test measures the assembled title, including that suffix.
The example configures TITLE_MAX = 60 and DESCRIPTION_MAX = 160. These are the project’s approximate working budgets, not guarantees about how every search engine, device, or result display truncates metadata. The article provides no controlled evidence that those exact limits apply universally or that meeting them improves search performance.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →How should the test account for a shared suffix?
Read the template instead of duplicating its suffix
One option is to copy the suffix into the test as a constant. That is simple, but if the layout changes and the constant does not, the test measures a stale title. Pertu’s example reads the layout and extracts the suffix from the template that actually applies it.
#1 Best Overall
Because source parsing can stop matching after a code change, the test also asserts that the layout contains a title template and that the template includes %s, the placeholder for the page title. If either condition is false, the test fails visibly instead of reporting a length based on an unsupported assumption. Reading source with a regular expression is a project-specific compromise, not a universal parsing recommendation; adapt it to the conventions and tooling in your own codebase.
Measure the completed string
After extracting the suffix, combine it with each authored title and measure that rendered string against the configured budget. For the example’s 10-character suffix, a 58-character authored title becomes 68 characters. That is why checking the authored value alone can produce a passing test even when the assembled value exceeds the project’s chosen limit.
Rank #2
How can you cover metadata from different sources?
The example site stores some page metadata in data collections and declares other metadata directly in static page.tsx files. The test handles each source in the way it is represented, rather than assuming a single scan will cover both.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Iterate over data-backed pages
For alert, comparison, audience, and guide pages, the test checks every entry in the corresponding collections. It also asserts that each collection contains entries. Without that check, an empty collection would run zero assertions and could leave the test green while the intended coverage had disappeared.
Inspect static page declarations
For static page.tsx files, the example walks the app directory and reads literal metadata fields. Its parser handles simple string literals, including strings split across lines. Titles are required: if a title cannot be parsed, the test fails rather than silently skipping it. A description can be absent when it is inherited from the layout, so the example does not treat every missing page-level description as an error.
This source-inspection approach has limits. It does not establish how to parse every possible JavaScript or TypeScript expression, and the article gives no framework or runtime version numbers. If metadata is assembled dynamically in your project, use a test that can evaluate or otherwise validate the actual output rather than assuming a literal-source parser can understand it.
Rank #4
How do you prevent discovery gaps from passing?
A reliable metadata test must establish not only that discovered values are valid, but also that it discovered the expected inputs. An empty loop or a file walk pointed at the wrong location can produce no failing assertion at all.
Recommended Free Tools
- Assert that each metadata collection is non-empty before iterating over it.
- Fail when a required title cannot be parsed; do not turn unknown input into a skipped check.
- Assert that the static page walk finds pages. In Pertu’s project, the minimum is ten pages; that threshold is specific to the described site, not a general requirement.
- Skip API routes and dynamic route files only when their metadata is covered through another verified source, as the example does for dynamic routes backed by checked collections.
The article also describes an extensionless re-export resolution issue with the project’s alerts barrel. Its workaround imports site files by globbing a directory, which discovers new market files automatically. The described market files are uk.ts, netherlands.ts, and europe.ts. This is a response to that project’s resolver behavior, not evidence that directory globbing is necessary or preferable in other setups.
What did the example test report?
Pertu reports that the site-specific test run had 21 tests, all 21 passing, zero failing, and a duration of 101.5 ms. The longest rendered title was 59 characters, the longest description was 158 characters, and median title headroom after accounting for the suffix was six characters. These are the author’s reported measurements for that site in 2026, not independently measured benchmarks or results that can be generalized to another project.
The practical lesson is to make the check follow the same sources and transformations that produce the metadata, while making missing coverage and unrecognized input fail loudly. As Pertu puts it: “The failure mode a scraping test has to design against is not a wrong answer, it is a confident green tick on a file it no longer understands.”
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

