-
Notifications
You must be signed in to change notification settings - Fork 202
Migrate no-workspace integration tests to Jest #1782
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
Migrate no-workspace integration tests to Jest #1782
Conversation
This migrates all no-workspace VSCode integration tests to Jest by running `npx jest-codemods`, followed by manual fixes (mostly for Sinon and Proxyquire).
This results in parallel downloads of VSCode, which is not supported.
The timeouts need to be set either on a per-file basis, or per test by using the parameter in `it`. Since we have both Mocha and Jest types, we need to declare in the test file which one we're using.
e370f26
to
a985bcb
Compare
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.
Looks pretty good to me, although with the caveat that I'm not an expert on Jest and I haven't been following along with the conversion chat as much as other people have been. I also didn't read the auto-generated commit, but I read the rest of the commits, and the resulting code looks pretty good.
The windows tests seem to be failing. Is that an unrelated error or something to do with this PR?
So long as the tests pass and the auto-conversion looks somewhat sensible, is it better to get a quick review and merge this PR to minimise disruption?
Thanks for the review!
That is related to this PR. The
I think that is indeed the best course of action. The PR is going to a feature branch anyway and I think the configuration can be re-used by other integration test directories, so it's valuable to have those in there. |
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.
Generally looks good to me. I can't say I've looked at all the changes though... there's A LOT!
When running locally I get 1 error - launching with no specified workspace › should not activate the extension at first
, but happy for us to look at that separately.
extensions/ql-vscode/src/vscode-tests/no-workspace/activation/activation.test.ts
Outdated
Show resolved
Hide resolved
extensions/ql-vscode/src/vscode-tests/no-workspace/contextual/queryResolver.test.ts
Outdated
Show resolved
Hide resolved
extensions/ql-vscode/src/vscode-tests/no-workspace/query-history.test.ts
Outdated
Show resolved
Hide resolved
Instead of calling `fail` and catching an error, this will use the `rejects.toThrow` assertion to check that a Promise rejects with a specific error.
Thanks for the review!
Have you removed the |
This migrates all no-workspace VSCode integration tests to Jest by running
npx jest-codemods
, followed by manual fixes (mostly for Sinon and Proxyquire).Checklist
ready-for-doc-review
label there.