Skip to content

Add test.each() to support BDD #1296

@unional

Description

@unional

This will help to support usage such as:

test.beforeEach(t => {
  t.context.game = new Game()
})

test.each(
[
  { c1: 1, c2: 2, dir: 'west' },
  { c1: 2, c2: 3, dir: 'south' },
  { c1: 3, c2: 4, dir: 'east' },
  { c1: 4, c2: 5, dir: 'north' }
], t => {
  const { game, c1, c2, dir } = t.context
  game.createAndConnectCaverns(c1, c2, dir)
  const p = game.createPlayerIn(c1)
  p.move(dir)
  t.is(p.location, c2)
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions