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

Unhandled error when suite name is a function reference #1201

Closed
6 tasks done
underfisk opened this issue Apr 27, 2022 · 1 comment
Closed
6 tasks done

Unhandled error when suite name is a function reference #1201

underfisk opened this issue Apr 27, 2022 · 1 comment

Comments

@underfisk
Copy link

Describe the bug

Recently during migration from Jest to Vitest I've encountered that my tests were existing with process exit code 1 because one of my describe blocks was using the function reference as the name (Jest under the hood used .name therefore it was working as if we pass MyFunction.name) but with Vitest it just silently throws an error

Reproduction

function MyReactHook(){
  const myFunction = () => {}
  return {myFunction}
}

describe(MyReactHook, () => {
  it('should render', () => {
    // TODO: This is just a mimic, we could use renderHook
  })
})

The code above will lead to the problem shown on the screenshot below

Screenshot 2022-04-27 at 11 48 16 PM

System Info

System:
    OS: macOS 12.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 8.00 GB / 64.00 GB
    Shell: 3.2.2 - /usr/local/bin/fish
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.7.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Safari: 15.4

Used Package Manager

yarn

Validations

@sheremet-va
Copy link
Member

Resolved in #1202

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants