Giter Site home page Giter Site logo

Comments (2)

Maxim-Mazurok avatar Maxim-Mazurok commented on August 20, 2024

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.

Maxim-Mazurok avatar Maxim-Mazurok commented on August 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.