Skip to main content

Command Palette

Search for a command to run...

U - Unit Under Test

Updated
1 min read
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