-
Notifications
You must be signed in to change notification settings - Fork 45
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
Link to Update Snapshot is not working #2749
Comments
You mention In the place of Wallaby diagnostics report section (above), it looks like you have provided a manual Wallaby configuration file. If you are attempting to run Could you please provide us with your Wallaby Diagnostics report? To share the report:
Also, are you able to share the code that has this problem so that we can see it for ourselves (perhaps privately via email if privacy is a concern)? We're a little confused as to the exact steps that you're taking to understand the problem so it might help if we can play around and see for ourselves. |
Yes I did mean snapshot. And I did the exact steps you list to get the data that I pasted in the Wallaby diagnostics report section. If my configuration is using jasmine, please tell me how to change the configuration to use Jest. I'm sure I installed it following the directions. I'm using VS Code on Windows 10 and the project is a CRA generated framework. Doesn't installing the Wallaby extension handle it all? But just thinking about what I did to install Wallaby gives me an idea about what may be the problem. My current project is a union of two difference development projects #1 and #2. #1 was done first and is a CRA app with all the UI for a financial planning app. This was done before I even knew about Wallaby. #2 is the calculation engine that creates the financial data for the UI. #2 was developed separately from converted VB.Net code and is like 60,000 lines of code. #2 was developed using node with babel so I could code it with es6 imports. This is where I learned about Wallaby and it was installed there on VS Code. Just recently I merged these two projects together and the Wallaby extension was carried over. Would that have configure Wallaby incorrectly for the present merged project? If so, how do I configure it correctly? Uninstall and reinstall? Edited: P.S. When I run all the Jest tests, I use the .vscode launch.json file using this configuration , which was what I used when working on the calculation engine in #2 project. This is to enable debugging support.
|
This may well be the cause of your problem. It seems that your Wallaby diagnostic report didn't copy properly as the format you provided is not what is provided by the command. I am guessing that you have a Wallaby does not currently support running multiple different frameworks at the same time (i.e. all of your tests must be jest, or all must be jasmine). If everything is not using the same framework, you can create different configurations to run them separately (e.g.
There is no need to reinstall. Without knowing your project structure and how you're running the calculator tests, we can't provide you with exact steps. Assuming you're running the calculator and CRA tests in different frameworks, the steps below should help.
wallaby.jest.js module.exports = () => ({
autoDetect: true
});
wallaby.jasmine.js module.exports = () => {
return {
files: [
"src//*.js"
],
tests: [
// TODO: update to exclude any tests that are run using jest
"src//*.spec.js"
],
env: {
type: "node",
},
};
};
If all of your tests are running with |
I'm using Jest for all my tests, so I added "wallaby": { "autoDetect": true }, to my package.json. Now when I run Wallaby diagnostics report, I get the whole thing. Thanks for you help. |
Issue description or question
Wallaby's link to Update Snapshot is not working correctly. Here's the scenario:
I have many Jest test suites. I spent a bit of time yesterday to resolve snapshot errors that were expected due to my code changes. All the snapshot errors plus a few other errors were in a single Jest test suite. I was running only this single test suite, and I clicked your X errors link to use your command window (terminology ?) to see side-by-side diff's and to click Update Screenshot. This all worked. The single test suite ran with all tests passing, the screen shot errors and the few other errors were gone.
Then I switched my launch.json action to the one that runs all the Jest test. And here I still get the Screenshot errors and the others in that one test suite. Again I use Wallaby to inspect the diff's and to update the screen shots. But when I again run all the Jest tests, the terminal output still shows the same errors in that one suite. And when I click your X tab to get the command window, you do not show me any screeshot errors, only the few other ones. Very strange.
Going back to run the single Jest test suite, it runs with all passing. But running the all Jest test suites continues to show the screenshot errors and the others that were cleared in the individual test run. So it appears that the Wallaby link to update the screenshots didn't work when I was using the launch.json to run all tests. But apparently Wallaby think they were updated and doesn't show them, yet the other errors that were cleared in the individual run when the screenshot were actually updated still are seen by Wallaby. So the screenshots were not updated, even though Wallaby thinks they are.
Wallaby diagnostics report
module.exports = () => {
return {
files: ['src//*.js'],
tests: ['src//*.spec.js'],
env: {
type: 'node',
},
}
}
The text was updated successfully, but these errors were encountered: