Skip to content

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

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

Merged
merged 2 commits into from
Nov 20, 2018

Conversation

elukoyanov
Copy link
Collaborator

@elukoyanov elukoyanov commented Nov 15, 2018

Fixes #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

@elukoyanov elukoyanov changed the title WIP: fix steps output for CLI for async functions Fix steps output for CLI for async functions Nov 16, 2018
@elukoyanov elukoyanov changed the title Fix steps output for CLI for async functions Fix steps output for CLI for async/arrow functions Nov 16, 2018
@elukoyanov
Copy link
Collaborator Author

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
Copy link
Contributor

Wow, that is cool. Thank you!

@DavertMik DavertMik merged commit 406aaa0 into codeceptjs:master Nov 20, 2018
@elukoyanov elukoyanov deleted the fix-cli-steps-async-output branch January 29, 2019 06:42
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.

Problem when not using parentheses around I in arrow functions
2 participants