-
Notifications
You must be signed in to change notification settings - Fork 7
Great effort, but can't make this work #2
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
Comments
Hello, |
Please check out this repo: https://github.com/tomitrescak/semantic-ui-mobx/tree/RemoveValue it('fails', () => {
const test = new Test();
// works
expect(test.validate()).toMatchSnapshot();
// does not work
test.validate().should.matchSnapshot();
}); |
@tomitrescak However, the first one you've marked with |
Stupid question - but did you restart the TS server/VScode after changing tsconfig.json ? |
@asvetliakov thanks for your help. Restart on that small repo seemed to solve the issue, but it does not work on my big repo. I will investigate. There is one problem and that is that the custom snapshot package I use allows to rename the snapshot and then these snapshots are not found. I'll just probably stop renaming. Will post back and close the issue once all is solved. |
ah sorry, but specifying custom snapshot names (such as |
Any advice on how can I debug this? I just can't make it work im my big project. In my small projects it works. I tried to put console.logs in the .js files, but then the plugin is not loaded at all. |
If you can provide the full copy of the one test file which doesn't work with corresponding snapshot - it would be best. The errors/missing references/imports/etc... shouldn't matter, just single test file and snapshot. The console.log won't work in the plugin since the plugins must do logging via something like The error may be caused by few things:
Also enabling logging in the TS server and checking it may provide some clues too |
If you want to debug by self, you need to pass Then you can log by using this statement: logger.info("Some log"); pass logger further if needed. |
@tomitrescak |
@asvetliakov thanks for your answers. I debugged it with your help and found out that the test structure got in the way as I was using a custom TDD interface (not only it, describe). |
@asvetliakov I can't get the plugin to work on 3 different projects. I even tried the project noted in a comment above and it doesn't work. Can you please retest with the project above and let me know if it does still work? |
@christianvogt Did you switch the TS version in VS code to workspace version? |
@asvetliakov I have this in my vscode settings: I also checked out the project above and it doesn't work for me. |
@christianvogt Just setting the setting doesn't work since vscode 1.13 or so (i don't remember exactly). You need manually to click on the TS version and choose "Use workspace typescript version" (once per workspace folder) otherwise it will continue to use the bundled TS. I'll recheck the project in comment above today and let you know. Also, you can try to enable TS server logging in vscode and check in the log if the plugin was loaded correctly. |
@christianvogt |
@asvetliakov clicking on the version and choosing to use workspace made it work! Thanks for the tip. |
Hi. Not sure why I can't make this work in vscode.
This is my tsconfig.json
this is my tasks.json
I have my environment set to local Typescript "2.7.2"
and this is the test file:
I have no options for snapshot when hovering over
matchSnapshot
The text was updated successfully, but these errors were encountered: