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

💅 [noMisplacedAssertion] The rule does not support it.each in vitest #2443

Closed
1 task done
motss opened this issue Apr 14, 2024 · 0 comments · Fixed by #2453
Closed
1 task done

💅 [noMisplacedAssertion] The rule does not support it.each in vitest #2443

motss opened this issue Apr 14, 2024 · 0 comments · Fixed by #2453
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@motss
Copy link

motss commented Apr 14, 2024

Environment information

❯ ppm biome rage --linter
CLI:
  Version:                      1.6.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v21.0.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.7"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 false

Linter:
  Recommended:                  true
  All:                          false
  Rules:                        a11y/all = true
                                complexity/all = true
                                complexity/noExcessiveCognitiveComplexity = "off"
                                complexity/noStaticOnlyClass = "off"
                                complexity/noUselessSwitchCase = "off"
                                complexity/useSimplifiedLogicExpression = "off"
                                correctness/all = true
                                nursery/all = true
                                nursery/noConsole = "off"
                                nursery/useImportRestrictions = "off"
                                performance/all = true
                                security/all = true
                                style/all = true
                                style/useNamingConvention = {"level":"error","options":{"strictCase":false}}
                                suspicious/all = true
                                suspicious/useAwait = "off"

Workspace:
  Open Documents:               0

Rule name

lint/nursery/noMisplacedAssertion

Playground link

https://biomejs.dev/playground/?lintRules=all&code=aQB0AC4AZQBhAGMAaAAoAFsAXQApACgAJwB0AGUAcwB0ACcALAAgACgAKQAgAD0APgAgAHsACgAgACAAZQB4AHAAZQBjAHQAKAB0AHIAdQBlACkALgB0AG8AQgBlACgAdAByAHUAZQApADsACgB9ACkAOwA%3D

Actual result

This is the warning message when it.each() is used.

The assertion isn't inside a it(), test() or Deno.test() function call.biomelint/nursery/noMisplacedAssertion

// src/__tests__/some.test.ts
it.each([])('test', () => {
  expect(true).toBe(true);
});

Expected result

The following code should work without any errors or warnings and it.each() should be supported.

it.each([])('test', () => {
  expect(true).toBe(true);
});

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Apr 14, 2024
@ematipico ematipico added the S-Help-wanted Status: you're familiar with the code base and want to help the project label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants