Every developer is expected to ___ a unit test for each new function they add to the codebase.
To write a test means to produce automated code that verifies a unit of behaviour. Write is the standard collocation for creating test code, as in "write unit tests" and "write a regression test." Make up, build out, and create over are not the idiomatic phrases here. Engineers say "write a test for every public method," so write a test is the correct collocation for the act of producing automated checks that guard a codebase against regressions.
2 / 5
CI will ___ the full suite on every pull request to catch regressions before merging.
To run the suite means to execute a collection of automated tests together. Run is the standard test collocation, as in "run the tests" and "test runner." Play through, drive, and operate are not idiomatic for automated test execution. CI pipelines "run the test suite on every commit," so run the suite is the correct collocation for executing all automated checks to verify the codebase is still correct.
3 / 5
The new feature must ___ all existing tests before the PR can be merged.
Tests pass when they execute without errors and all assertions succeed. Pass is the standard test result verb, contrasted with "fail." Clear through, succeed over, and win are not used in this context. CI dashboards show "all checks passed," so pass the tests is the correct collocation for achieving a green result that confirms the code works as expected.
4 / 5
To isolate the unit under test, the developer will ___ the external HTTP client so it returns a fixed response.
To stub a dependency means to replace it with a minimal stand-in that returns a predefined response. Stub is the precise testing term, contrasted with "mock" (which verifies interactions). Fake out, trick, and replace over are informal and imprecise. Developers say "stub the HTTP client to return a 200," so stub the client is the correct collocation for substituting a real dependency with a controlled fake during unit testing.
5 / 5
The team uses Jest to ___ the analytics module and verify that tracking events are sent correctly.
To mock a module means to replace it with a controlled fake that records calls so the test can verify interactions. Mock is the precise term, as in "mock the API client" and Jest's jest.mock(). Pretend, copy, and simulate out are not real testing collocations. Developers "mock the analytics module and assert it was called with the right payload," so mock the module is the correct collocation for creating a verifiable substitute in test code.