Skip to content
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

Improve errors logging #82

Open
Aboisier opened this issue Jul 22, 2021 · 0 comments
Open

Improve errors logging #82

Aboisier opened this issue Jul 22, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Aboisier
Copy link
Collaborator

Recently, the logging was improved by printing the stacktrace of failed tests.

It would be interesting to see a summary of the failed tests to prevent having to scroll to find failed tests.

Current behaviour

Root
  Expect ArraysToBeEqual Test Suite
    Arrays to be equal
      √ arrays with undefined values
      √ empty arrays

[cropped]

  Test Runner Visitor Error Messages Tests
    x Asynchronous tests failures  - Expected test to succeed.
      Error: Expected test to succeed.
          at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
          at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
          at Generator.next (<anonymous>)
          at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)
    √ Tests failures
  
  Test Runner Visitor Tests
    x Simple test suite - Expected B to equal C.
      Error: Expected B to equal C.
          at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
          at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
          at Generator.next (<anonymous>)
          at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)
    √ Test suite with failure
    √ Test suite with skipped tests
    √ Skipped and focused

  Tests Suite Testszz
    √ get tests, all normal tests


Summary: 182/183 passed, 1/183 failed, 0/183 skipped. (0.202s)

Suggested behaviour

Root
  Expect ArraysToBeEqual Test Suite
    Arrays to be equal
      √ arrays with undefined values
      √ empty arrays

[cropped]

  Test Runner Visitor Error Messages Tests
    x Asynchronous tests failures  - Expected test to succeed.
      Error: Expected test to succeed.
          at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
          at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
          at Generator.next (<anonymous>)
          at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)
    √ Tests failures
  
  Test Runner Visitor Tests
    x Simple test suite - Expected B to equal C.
      Error: Expected B to equal C.
          at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
          at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
          at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
          at Generator.next (<anonymous>)
          at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)
    √ Test suite with failure
    √ Test suite with skipped tests
    √ Skipped and focused

  Tests Suite Testszz
    √ get tests, all normal tests

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Summary: 182/183 passed, 1/183 failed, 0/183 skipped. (0.202s)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

x Asynchronous tests failures  - Expected test to succeed.
  Error: Expected test to succeed.
      at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
      at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
      at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
      at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
      at Generator.next (<anonymous>)
      at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)

x Simple test suite - Expected B to equal C.
  Error: Expected B to equal C.
      at Expect.toBeEqual (C:\testyts\TestyTs\src\lib\assertion\expect.ts:34:13)
      at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:16:12)
      at Function.expectReportsToBeEqual (C:\testyts\TestyTs\src\spec\utils\testUtils.ts:28:12)
      at TestRunnerVisitorTests.<anonymous> (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:44:15)
      at Generator.next (<anonymous>)
      at fulfilled (C:\testyts\TestyTs\src\spec\tests\testRunnerVisitor.spec.ts:11:58)
@Aboisier Aboisier changed the title Improve logging Improve errors logging Jul 22, 2021
@Aboisier Aboisier added enhancement New feature or request help wanted Extra attention is needed labels Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant