-
Notifications
You must be signed in to change notification settings - Fork 1.3k
First steps in functional tests for the native window #7513
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7513 +/- ##
==========================================
+ Coverage 58.7% 58.78% +0.07%
==========================================
Files 494 493 -1
Lines 21838 21810 -28
Branches 3503 3496 -7
==========================================
Hits 12821 12821
+ Misses 8216 8188 -28
Partials 801 801
Continue to review full report at Codecov.
|
| @@ -0,0 +1,329 @@ | |||
| // Copyright (c) Microsoft Corporation. All rights reserved. | |||
| // Licensed under the MIT License. | |||
| 'use strict'; | |||
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.
strict [](start = 5, length = 6)
This file was originally the interactiveWindowTestHelpers.tsx, but I modified it to be more generic so we could reuse most of it.
| // ansiToHtml is different between the tests running and webpack. figure out which one | ||
| // tslint:disable-next-line: no-any | ||
| if (ansiToHtml instanceof Function) { | ||
| CellOutput.ansiToHtmlClass_ctor = ansiToHtml; |
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.
Is this the commonjs vs ES6 default import issue?
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.
Yep. Had the same problem with memoize in the variable explorer.
Tests use one format and webpack uses the other.
In reply to: 326731645 [](ancestors = 326731645)
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.
Yeah, I ran into this with node-fetch as well. I think this solution seems fine to me. But I did see one site that I was looking into with node-fetch that was mentioning that webpack could be configured to pick main config over module config. Not sure if that is really worth looking into, but it might make this code unneeded. node-fetch/node-fetch#450
In reply to: 326733133 [](ancestors = 326733133,326731645)
| // Export should cause exportCalled to change to true | ||
| const exportButton = findButton(wrapper, NativeEditor, 5); | ||
| await waitForMessageResponse(() => exportButton!.simulate('click')); | ||
| assert.equal(exportCalled, true, 'Export should have been called'); |
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.
Can't you just use a Times on the setup function and then do a verify on that? Seems less fragile than tracking an extra bool.
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.
That would probably be better. I just copied this from what I had before for the interactive window.
In reply to: 326737902 [](ancestors = 326737902)
IanMatthewHuff
left a comment
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.
![]()
For #7367
First couple of tests for native editor. Did a bunch of refactoring to get shared code between interactive window and the native editor.