fix(valid-mock-module-path): don't report virtual mocks#1946
Conversation
ebade85 to
c16102c
Compare
c16102c to
9cdb5e6
Compare
There was a problem hiding this comment.
you're missing a bunch of cases - what if...
- an array or function is passed in as the param
- a variable is passed as the param
- an object is passed, without any properties
- an object is passed, which has a spread
- an object is passed, with a property that is not
virtual - an object is passed, with a computed property
- ...whose key comes from a variable
- ...whose key is a string literal...
- ...which is
virtual - ...which is not
virtual
- ...which is
- ...whose key is a template string literal...
- ...which is
virtual - ...which is not
virtual - ...which has interpolation
- ...which is
- an object is passed, with the
virtualproperty but whose value...- ...is a variable
- ...is a variable, and is shorthanded
- ...is an array or function
- ...is a number
Within these cases, you should find your missing coverage 🙂
I assume this is a response to my "a test case that can trigger the else path" question? If so, I'll see if one of these triggers the else path. Many of these I've already considered (computed property, passing function, object spread, etc) 🙂 |
|
Yes and no - these are all tests that you should have, because most of them have different AST shapes, and I know they will cover your |
|
Spread was literally the first thing I tried, haha. However, I'm getting a syntax error from your test pipeline when I include it. Is there something specific I should add there to enable that syntax? As for the other test cases, looking at the existing tests for this rule, I tried to match their level of exhaustiveness. Unfortunately I'm approaching the end of my timebox for this, so I can't go much further beyond that this week |
Looks like this: (I'm coming from babel land, where it's usually an incantation/config property/package to get syntaxes working) |
You want to adjust the configuration being passed to |
## [29.15.2](v29.15.1...v29.15.2) (2026-04-09) ### Bug Fixes * **valid-mock-module-path:** don't report virtual mocks ([#1946](#1946)) ([a1916d1](a1916d1))
|
🎉 This PR is included in version 29.15.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #1945