Comments (2)
Same error:
describe("tickForFormula", () => {
it("works for currency", () =>
expect(
tickForFormula(new Tick(new Currency("uah"), new Currency("aud")))
).toBe("CURRENCY:UAHAUD"));
});
> eslint --fix --max-warnings 0 .
Oops! Something went wrong! :(
ESLint: 8.29.0
TypeError: Cannot read properties of undefined (reading 'length')
Occurred while linting C:\Users\maxim.mazurok\transactions\legacy\analytics\util.spec.ts:2
Rule: "vitest/expect-expect"
at C:\Users\maxim.mazurok\transactions\node_modules\eslint-plugin-vitest\dist\index.cjs:308:30
at Array.some (<anonymous>)
at CallExpression[callee.name=/^(it|test)$/] (C:\Users\maxim.mazurok\transactions\node_modules\eslint-plugin-vitest\dist\index.cjs:307:32)
at ruleErrorHandler (C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\linter.js:1115:28)
at C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\node-event-generator.js:297:26) at NodeEventGenerator.applySelectors (C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (C:\Users\maxim.mazurok\transactions\node_modules\eslint\lib\linter\node-event-generator.js:340:14)
from eslint-plugin-vitest.
@veritem this still doesn't seem to work in the latest version, maybe a regression. Here's a minimal reproduction:
import { expect, it } from "vitest";
const myFunc = () => {};
it("works", () => expect(myFunc()).toBe(undefined));
Here's the error:
Oops! Something went wrong! :(
ESLint: 8.31.0
TypeError: Cannot read properties of undefined (reading 'length')
Occurred while linting my_project\legacy\analytics\util.spec.ts:5
Rule: "vitest/expect-expect"
at my_project\node_modules\eslint-plugin-vitest\dist\index.cjs:323:30
at Array.some (<anonymous>)
at CallExpression[callee.name=/^(it|test)$/] (my_project\node_modules\eslint-plugin-vitest\dist\index.cjs:322:32)
at ruleErrorHandler (my_project\node_modules\eslint\lib\linter\linter.js:1115:28)
at my_project\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (my_project\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (my_project\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (my_project\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (my_project\node_modules\eslint\lib\linter\node-event-generator.js:340:14)
npx envinfo
System:
OS: Windows 10 10.0.19044
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900H
Memory: 39.38 GB / 63.68 GB
Binaries:
Node: 19.3.0 - ~\AppData\Local\nvs\default\node.EXE
npm: 9.2.0 - ~\AppData\Local\nvs\default\npm.CMD
"@typescript-eslint/eslint-plugin": "5.48.1",
"eslint": "8.31.0",
"eslint-import-resolver-typescript": "3.5.3",
"eslint-plugin-import": "2.27.4",
"eslint-plugin-jest": "27.2.1",
"eslint-plugin-unicorn": "45.0.2",
"eslint-plugin-vitest": "0.0.29",
from eslint-plugin-vitest.
Related Issues (20)
- Feature request: formatting rules HOT 1
- Invalid flat config HOT 2
- `bench` throw error `Prefer using it instead of test within describe`
- `expect-expect` fails even if `expectTypeOf` is present HOT 7
- Add require `describe`, `it` and `vi` import HOT 1
- Extend the `no-identical-title` rule to support `suite` test block pattern HOT 4
- Consider rule for naming mocks created with `vi.fn()` HOT 1
- Results of weekly scheduled smoke test HOT 1
- Throwing with ESLint 9 and flat config HOT 1
- [BUG] Converting circular structure to JSON HOT 5
- Please provide non-flat config HOT 6
- Declaration file missing plugin configs
- Results of weekly scheduled smoke test HOT 8
- TypeError: Converting circular structure to JSON when extend the recommended HOT 3
- Feature request: `prefer-vi-mocked` HOT 1
- tsc: Fix issues related to types HOT 1
- Readme docs is outdates
- Publish v0.6.0 to NPM HOT 19
- pnpm complains of unmet peer dependency. HOT 6
- `vitest/unbound-method` does not work in legacy config HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-vitest.