[Question] How to ignore first argument in test()
See original GitHub issueI’m using @playwright/test v1.14.1.
I followed the instruction in this page https://playwright.dev/docs/test-parallel/#reusing-single-page-between-tests.
All seems fine, until I try to ignore first parameter in the test() by using _ as I normally doing in typescript.
When I try to run the test I got this error: Error: First argument must use the object destructuring pattern: _
test.describe.serial('test case 1', () => {
test('test step 1', async (_, testInfo) => {
// Error: First argument must use the object destructuring pattern: _
})
})
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Jest test function ignoring first two arguments - Stack Overflow
I'm currently trying to test some of my code using jest but for some reason if I send in 4 arguments in the...
Read more >How to skip the first argument in a script - Unix Stack Exchange
You can use shift command like this: shift for arg in "$@" do cat "$arg" done.
Read more >Ignore some arguments · Issue #30 · gojuno/minimock - GitHub
I personally like first solution better because func that we pass to the Inspect has exactly same arguments as the method we're mocking....
Read more >Loose assertions on arguments passed to function with Jest
Use the asymetric matcher expect.anything() to ignore the first argument passed to foo . test("Match any argument" ...
Read more >Chapter 4 Labeled arguments - OCaml
Note that if that argument is labeled, you will only be able to eliminate optional arguments by totally applying the function, omitting all...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Curious, why is the destructuring required?
Why can’t I just do
test("test", async (t) => t.page.goto(somewhere))@mxschmitt thanks for your answer. Yes, that solve the error, but I need to turn off my
eslintrule. https://eslint.org/docs/rules/no-empty-pattern I will live with this for now. It would be great if we could use_instead of{}in the future.