-
Notifications
You must be signed in to change notification settings - Fork 17
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
PR for #29 #33
PR for #29 #33
Conversation
Didn't bother rewriting the tests yet because this idea might get scrapped. Probably should make createState and removeUncheckedKeys accessible like other functions are defined in index. With current state creating ci and update could be removed form determineConfig.js.
Thanks, I'll take a look soon |
@suchipi did you get a chance to look into this? :) |
Sorry, I looked at it briefly but have not had a chance to follow back up, I apologize for the long delay. I don't think there's a straightforward way to support both |
@@ -65,6 +66,9 @@ chaiJestSnapshot.resetSnapshotRegistry = function resetSnapshotRegistry() { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the stuff you had in your beforeEach to configureUsingMochaContext
?
@@ -65,6 +66,9 @@ chaiJestSnapshot.resetSnapshotRegistry = function resetSnapshotRegistry() { | |||
} | |||
} | |||
|
|||
chaiJestSnapshot.createState = snapshotStateHandler.create; | |||
chaiJestSnapshot.removeUncheckedKeys = snapshotStateHandler.removeUncheckedKeys; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will have to refactor the documentation to note that you need to call these in your beforeAll
/afterAll
.
src/snapshotStateHandler.js
Outdated
let states = {}; | ||
|
||
module.exports = { | ||
create: ({snapshotPath, ci, update}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ci
and update
arguments can stay internal here (hardcoded to the process environment variables); the public interface should only take the path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! :)
Process env variables are strings and currently updateSnapshot was "none" all the time.
These weren't removed before and therefor affected matchSnapshot tests.
Thanks for the review! There are still couple of things missing:
|
Not the best test coverage but should give an overview what is going on.
@suchipi could you take another look at this? |
Hey, sorry for the radio silence on this. I will try to take a look soon. |
Hey, @suchipi! Could you have a look at this? :) |
Hey, I'm sorry this is still open. I took a look 22 days ago when you commented and started working through behavior and thinking about how it should work, but I didn't have time to finish. I'll let you know when I look at it again- sorry again and thank you for being so patient 🙏 |
@andrestaht are you interested in me giving you write access to this repo and you being a co-maintainer of the package? |
@suchipi why not :) |
I'm interested in this feature as well. Anything I can do to move this along? |
Any update? |
Sorry for the silence. I switched companies and this dependency is no longer part of the stack. If someone still sees value in this then feel free to take it over. I'll help with the review and getting the PR released. Sorry again for this long unactivity. |
Didn't bother rewriting the tests yet because this idea might get scrapped.
Probably should make
createState
andremoveUncheckedKeys
accessible like other functions are defined inindex.js
.With current state creating ci and update could be removed form
determineConfig.js
.My
mochaSetup.js
: