Testing275 Documents

Semantic Names

Name reusable test-support files after what they provide or do, using camelCase. Do not use generic labels such as fixture, helper, util, utility, harness, or testSupport. A file that provides a mock object should be named xMockProvider, for example paymentMockProvider.js.

Philosophy

Semantic names reveal what reusable test code provides or does. Naming files after their responsibilities makes them easier to find, understand, and reuse.

Correct

paymentMockProvider.js
paymentEnvironmentProvider.js
panel/testing/renderPaymentForm.jsx

Incorrect

paymentFixtureTests.js
testing/paymentHelper.js
testing/paymentUtils.js
panel/testing/formHarness.jsx

Fix

Rename the file according to its actual responsibility, such as paymentMockProvider.js for a mock provider, and update every import and reference. Do not replace one generic label with another.