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

[feature] add vitest #130

Merged
merged 9 commits into from
Mar 28, 2024
Merged

[feature] add vitest #130

merged 9 commits into from
Mar 28, 2024

Conversation

shellyear
Copy link
Collaborator

@shellyear shellyear commented Mar 24, 2024

Partially resolves #110

@blcham


 Test Files  39 passed | 5 skipped (44)
      Tests  272 passed | 21 skipped (293)
   Start at  22:12:40
   Duration  10.56s (transform 2.24s, setup 4.24s, collect 18.21s, tests 752ms, environment 11.13s, prepare 2.65s)

There are remaining errors that are not shown in the terminal, but in the build pipeline:
[1]

_[ This error originated in "tests/__tests__/actions/UserActions.spec.jsx" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

⎯⎯⎯⎯⎯ Uncaught Exception ⎯⎯⎯⎯⎯
AssertionError: expected [ …(3) ] to deeply equal [ { …(2) }, { …(3) }, { …(2) } ]_

[2]

Error: done() callback is deprecated, use promise instead
 ❯ context node_modules/@vitest/runner/dist/index.js:73:11
 ❯ Timeout._onTimeout tests/__tests__/actions/UserActions.spec.jsx:566:7
    564|     setTimeout(() => {
    565|       expect(store.getActions()).toEqual(expectedActions);
    566|       done();
       |       ^
    567|     }, TEST_TIMEOUT);
    568|   });
 ❯ listOnTimeout node:internal/timers:569:17
 ❯ processTimers node:internal/timers:512:7

This error originated in "tests/__tests__/actions/UserActions.spec.jsx" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.

[3] warning
stderr | tests/tests/components/User.spec.jsx > User > renders filled admin's form
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

UPD: all errors are runtime and relate to UserActions.spec.jsx

e.g

stdout | tests/__tests__/actions/UserActions.spec.jsx > User asynchronous actions > creates SAVE_USER_SUCCESS action when saving user successfully is done
{
  storeActions: [ { type: 'SAVE_USER_PENDING', actionFlag: 'CREATE_ENTITY' } ],
  expectedActions: [
    { type: 'SAVE_USER_PENDING', actionFlag: 'CREATE_ENTITY' },
    {
      type: 'SAVE_USER_SUCCESS',
      actionFlag: 'CREATE_ENTITY',
      user: [Object]
    },
    { type: 'LOAD_USERS_PENDING' },
    { type: 'LOAD_USERS_SUCCESS', users: [Array] }
  ]
}

@shellyear
Copy link
Collaborator Author

@blcham
There are runtime errors left, also @cfaester/enzyme-adapter-react-18 will be removed

@blcham
Copy link

blcham commented Mar 25, 2024

xit --> test.skip

@shellyear shellyear force-pushed the feature/vitest branch 3 times, most recently from 5683860 to 47e7e0b Compare March 25, 2024 17:59
@blcham
Copy link

blcham commented Mar 26, 2024

@shellyear still there are 57 files committed (i.e. to review), you need to rebase from main:
image

It seems that you forgot to do sync before rebase:
image

@shellyear
Copy link
Collaborator Author

shellyear commented Mar 26, 2024

@shellyear still there are 57 files committed (i.e. to review), you need to rebase from main: image

It seems that you forgot to do sync before rebase: image

@blcham I did it manually using, git fetch upstream & git pull upstream main. But most likely will use sync fork next time

Copy link

@blcham blcham left a comment

Choose a reason for hiding this comment

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

LGTM, nicely done!, can be merged after resolved comments

@blcham blcham self-requested a review March 26, 2024 09:34
Copy link

@blcham blcham left a comment

Choose a reason for hiding this comment

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

Note that tests are again failing.

@shellyear
Copy link
Collaborator Author

@blcham fixed the last error 03235d8

@blcham blcham self-requested a review March 28, 2024 00:54
Copy link

@blcham blcham left a comment

Choose a reason for hiding this comment

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

LGTM, good job!

@blcham blcham merged commit ffe7043 into kbss-cvut:main Mar 28, 2024
2 checks passed
palagdan added a commit that referenced this pull request Nov 25, 2024
palagdan added a commit that referenced this pull request Nov 25, 2024
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.

Fix tests
2 participants