Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scaffolds unit tests and screenshot tests to establish visual and functional rendering baselines for views before refactoring.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -20% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -16% | 0% |
This subskill establishes the safety net of existing and new visual/functional tests before any codebase modifications occur, ensuring that no rendering or logical regressions are introduced during modernization.
IndexedDBViews.test.tsfor IndexedDBViews.ts) under the target folder or test/unittests/.
test/interactions/ ortest/goldens/) matching the visual component to verify layout and styling.
file while missing another class being migrated (e.g., tests exist for IDBDatabaseView but are scarce/missing for IDBDataView).
migrated, draft a basic Mocha/Chai rendering test.
synthetic DOM helper or unit-test container.
CategorizedBreakpointsSidebarPane.test.ts:renderElementIntoDOM with {includeCommonStyles: true} to ensure styles are applied.{includeCommonStyles: true} to see if class isadding the styles itself. If the test pass, keep the version without {includeCommonStyles: true}. Otherwise, bring it back.
DEFAULT_VIEW) directly by passing mock state and callbacks.assertScreenshot to capture and verify the visual output.typescript it('renders the view', async () => { const target = document.createElement('div'); renderElementIntoDOM(target, {includeCommonStyles: true}); MyComponent.DEFAULT_VIEW(mockViewInput, undefined, target); await assertScreenshot('my_component/base.png'); });
Always detect the execution environment first to run tests successfully:
/google/cog/ or/google/src/.
npm run test or autoninja failbecause they lack Google cloudtop/virtualization wrapper configurations.
npm run test or standard autoninja directly.tests in the cloud workspace:
bash python3 internal/infra/scripts/cider/init_workspace.py test /google/cog/cloud/username/workspace_name --test_filter=front_end/panels/application/IndexedDBViews.test.ts
checkout without Cog paths.
vpython3: command not found orpython3_bin_reldir.txt not found.
depot_tools path:bash export PATH=$PATH:/path/to/depot_tools
once from the checkout root:
bash update_depot_tools
bash npm run test -- front_end/panels/application/IndexedDBViews.test.ts
ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for scripts/eslint_rules/...
parse the rules:
bash npm run build
div -> span).{includeCommonStyles: true}.Before reporting back or committing, re-read the instructions and verify:
Other measured skills in the registry, with their headline benchmark lift.