Skip to main content

Command Palette

Search for a command to run...

U - Unit Under Test

Published
1 min readView as Markdown
U - Unit Under Test

It's the first section in the name.

It specifies which is the unit that we're currently testing.

The unit can be in the same text as the other sections or separated in a group if we're going to create multiple unit tests for the same unit of code.

/** In this example the three sections of the name are in the same text.
 * The xxx refer to the other sections
 */
test("Airplane, xxx, xxx", () => {});

/** In this example the first section of the test name is in a group
 * because there will be multiple tests on the same unit.
 * The xxx refer to the other sections
 */
group("Airplane", () => {
  test("xxx, xxx", () => {});

  test("xxx, xxx", () => {});
});

🇨🇴 Versión en Español

Unit Testing

Part 17 of 19

Unit tests are a tireless guard that overwatch your software to ensure it always behaves as it's expected. In this series I'll introduce to you its basic concepts.

Up next

S - Scenario

or Inputs to the Unit