-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Cannot read properties of undefined (reading 'item') #97
Comments
I'm getting the same error. When I run the sample project I get
I also don't get any
|
Same here, I think this is related to having multiple tests using This code fails when I click "run" button in test explorer next to the "isWarning": import { describe, expect, test } from "vitest";
describe("isWarning", () => {
test.each([
[
"Uncaught ReferenceError: angular is not defined in https://bla.bla/assets/vendor/angularjs-dropdown-multiselect/angularjs-dropdown-multiselect.min.js at 3:143",
true,
],
["Cannot find default tariff with bookId '587dbb6986234155bd506185' in library books of country NZ", false],
])(`returns %s for %s`, (errorMessage, expected) => {
expect(true).toBe(true);
});
}); This is log:
This is what I see when I click "run" button next to "returns %s for %s": When I click "run" button next to the test file name - it doesn't show that error, but still shows test as not passed. All I have to do to fix the issue is to use different test argument strings, this works fine: import { describe, expect, test } from "vitest";
describe("isWarning", () => {
test.each([
["a", true],
["b", false],
])(`returns %s for %s`, (errorMessage, expected) => {
expect(true).toBe(true);
});
}); and this doesn't: import { describe, expect, test } from "vitest";
describe("isWarning", () => {
test.each([
["angularjs-dropdown-multiselect/angularjs-dropdown-multiselect", true],
["b", false],
])(`returns %s for %s`, (errorMessage, expected) => {
expect(true).toBe(true);
});
}); I don't think it's because of the special characters, changing argument length seems to help, but that seems to be kinda random... Also all works fine in CLI. |
would there be plans to address this issue later? |
Duplicate. Close in favor of #133 |
Describe the bug
When leveraging
test.each
and running tests via the vscode extension I see this error:The tests run just fine from the CLI.
To Reproduce
Steps to reproduce the behavior:
pnpm i
ornpm i
- I tested bothExpected behavior
The tests to pass just as they do in the CLI.
Screenshots
Environment
(Paste info.txt content generated by the example project)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: