CodeLenny / ava-test-style

:book: AVA Test Style Guide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add test 'constants'

CodeLenny opened this issue · comments

Tests may include some constant values in the file:

const test = require("ava");

const name = "bob";

test.beforeEach("create user", t => {
  t.context.user = new User(name);
});

test("has name", t => {
  const { user } = t.context;
  t.is(user.getName(), name);
});
  • Add to the "Test File Structure" list
  • Add description to a section under "Test File Structure"
  • See if it should be included in some of the test file examples in the README.