Skip to content

chore(01): step 1 - get pokemon by name#1

Open
fabernovel-fnguyen wants to merge 4 commits intomainfrom
01_code_review
Open

chore(01): step 1 - get pokemon by name#1
fabernovel-fnguyen wants to merge 4 commits intomainfrom
01_code_review

Conversation

@fabernovel-fnguyen
Copy link
Collaborator

No description provided.

it('findPokemonByNameOrFail - valid pokemon name', async () => {
const pokemonName = 'bulbasaur';
const pokemonStats =
await pokemonService.findPokemonByNameOrFail(pokemonName);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce qu'on fait dans nos tests, c'est l'écriture Gherkin

On pourrait faire ça ici, ça donnerait pour ce test:

  it('findPokemonByNameOrFail - valid pokemon name', async () => {
    // Given
    const pokemonName = 'bulbasaur';

    // When
    const pokemonStats =
      await pokemonService.findPokemonByNameOrFail(pokemonName);

    // Then
    expect(pokemonStats).toMatchObject({
      id: 1,
      name: 'bulbasaur',
      species: {
        name: 'bulbasaur',
        url: 'https://pokeapi.co/api/v2/pokemon-species/1/',
      },
      types: ['grass', 'poison'],
      weight: 69,
      height: 7,
    });
  });

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appliqué aux tests unitaires

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bon, donc on a mit un message sur slack 😄

Tu disais que ce serait mieux aussi de l'appliquer aux e2e 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants