New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix steps output for CLI for async/arrow functions #1329

Merged
merged 2 commits into from Nov 20, 2018

Conversation

Projects
None yet
3 participants
@LukoyanovE
Contributor

LukoyanovE commented Nov 15, 2018

Fix for #1321
CLI output did not print steps for some types of async and arrow functions.

  non-async non-arrow braces
    Runner: runTest 
  ✔ OK in 3001ms

  non-async arrow non-braces
    Test: I 
  ✔ OK in 2136ms

  non-async arrow braces
    I am on page "/"
  ✔ OK in 1814ms

  async non-arrow braces
    Runner: runTest 
  ✔ OK in 1814ms

  async arrow non-braces
    I am on page "/"
  ✔ OK in 1852ms

  async arrow braces
    I am on page "/"
  ✔ OK in 1759ms

Also reworked within test, cause it used step class as logger for strings instead of creating Step.
It broke new logic, as String has not Step's hasBDDAncestor method.

PS why we add spaces () before literal strings in Step.humanize()?

    // insert a space before all caps
      .replace(/([A-Z])/g, ' $1')

PS, why spaces are added in the end of cli output? For example I blabla instead of I blabla

Evgeny Lukoyanov added some commits Nov 15, 2018

Evgeny Lukoyanov

@LukoyanovE LukoyanovE changed the title from WIP: fix steps output for CLI for async functions to Fix steps output for CLI for async functions Nov 16, 2018

@codacy-bot

This comment has been minimized.

codacy-bot commented Nov 16, 2018

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- lib/output.js  3
         

See the complete overview on Codacy

@LukoyanovE LukoyanovE changed the title from Fix steps output for CLI for async functions to Fix steps output for CLI for async/arrow functions Nov 16, 2018

@LukoyanovE

This comment has been minimized.

Contributor

LukoyanovE commented Nov 16, 2018

Output after fix:

  non-async non-arrow braces
    Runner: runTest 
    I am on page "/"
  ✔ OK in 2993ms

  non-async arrow non-braces
    Test: I 
    I am on page "/"
  ✔ OK in 2286ms

  non-async arrow braces
    I am on page "/"
  ✔ OK in 1837ms

  async non-arrow braces
    Runner: runTest 
    I am on page "/"
  ✔ OK in 1812ms

  async arrow non-braces
    I am on page "/"
  ✔ OK in 1822ms

  async arrow braces
    I am on page "/"
  ✔ OK in 1848ms

Do not know, what should be done with
Runner: runTest and Test: I

@DavertMik

This comment has been minimized.

Member

DavertMik commented Nov 20, 2018

Wow, that is cool. Thank you!

@DavertMik DavertMik merged commit 406aaa0 into Codeception:master Nov 20, 2018

4 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
Hound No violations found. Woof!
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment