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

Take last match #94

Open
hannojg opened this issue Mar 9, 2021 · 0 comments
Open

Take last match #94

hannojg opened this issue Mar 9, 2021 · 0 comments

Comments

@hannojg
Copy link

hannojg commented Mar 9, 2021

Sorry, if this is not the right place to ask questions about how the formatting should be done in general πŸ™‡β€β™‚οΈ

I am trying to setup reviewdog for jest (in github actions). I want reviewdog to tell me about failed tests.
This is e.g. a output when a test has failed:

 PASS  src/store/media/api/__tests__/api.test.ts
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks.

Summary of all failing tests
 FAIL  src/store/conversation/matrix/middlewares/__tests__/roomDeletePendingCreationOnLastMessage.test.ts
  ● Test suite failed to run

    Cannot find module '../../../../../jobs/memory/upload/job' from 'src/store/conversation/matrix/middlewares/__tests__/roomDeletePendingCreationOnLastMessage.test.ts'

      41 | // Mocking our components that depend on reduxStore and are causing issues.
      42 | jest.mock("src/__dev__/AccountSetup", () => ({}));
    > 43 | jest.mock("src/jobs/memory/upload/job", () => ({}));
         |      ^
      44 | jest.mock("src/store/reduxStore", () => ({}));
      45 |
      46 | it("should remove pending creation when room gets updated with last message", () => {

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (src/store/conversation/matrix/middlewares/__tests__/roomDeletePendingCreationOnLastMessage.test.ts:43:6)


Test Suites: 1 failed, 5 skipped, 144 passed, 145 of 150 total
Tests:       9 skipped, 302 passed, 311 total
Snapshots:   138 passed, 138 total
Time:        56.5 s
Ran all test suites.

This is the efm pattern I got, which works nicely:

%-G%[%^ ]%.%#
%E%.%#● %m
%Z%.%#at %.%# (%f:%l:%c)
%C%.%#
%-G%.%#

However, for the failed test above it reports as file:
node_modules/jest-resolve/build/index.js:306:11

This is not correct, the error originates from:
src/store/conversation/matrix/middlewares/__tests__/roomDeletePendingCreationOnLastMessage.test.ts:43:6

There are two at lines at the end:

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (src/store/conversation/matrix/middlewares/__tests__/roomDeletePendingCreationOnLastMessage.test.ts:43:6)

How can I tell the errorformat to take the last at match?

Thanks in advance!

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

No branches or pull requests

1 participant