Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upExplain the newEvent helper function used in the live example of Testing docs #23370
Comments
Is this issue open for contribution? |
docsarea=testing @brandonroberts When you get a chance, would you look into this. The question is about the example code. Thanks! |
Hi @keilla! The code used there is not a typo. There is a |
@marzann this issue is open for contribution. Would you like to submit a PR? |
So far haven't been able to find any information on this random, basically un-duck-duck-go-able |
@brandonroberts Definitely looks to be a typo: shouldn't |
@1083 its not a typo, its not just exposed in the guide. The source for the example is here https://github.com/angular/angular/blob/master/aio/content/examples/testing/src/testing/index.ts#L23 |
@brandonroberts As we can in comment above this method, it's created only for better compatibility between browsers: Since angular tests are run on Chrome by default, maybe we don't need it any more? I think it might be confusing, especially if not documented. |
Hey, I would like to submit my first PR for this issue |
Trying to resolve the following issue: . . . Explain the newEvent helper function used in the live example of Testing docs angular#23370 . . . . angular#23370
sorry, I think i misunderstood. I don't know if any work is needed here |
@andrewasche, you could re-open your PR and instead of changing the code, you could explain the |
Because PhantomJS has been deprecated since March 2018, and `newEvent` is very confusing for newcomers that read the testing documentation, we remove it entirely, and instead assume most, if not all, newcomers will run tests in Chrome as it is the default. Fixes angular#23370
Thanks for the encouragement. I tried again to explain that newEvent is not a typo, I reopened my PR and got it right this time. |
next Try. . . I created a branch and tried to do it properly Here is my PR: |
Because PhantomJS has been deprecated since March 2018, and `newEvent` is very confusing for newcomers that read the testing documentation, we remove it entirely, and instead assume most, if not all, newcomers will run tests in Chrome as it is the default. Fixes angular#23370
Because PhantomJS has been deprecated since March 2018, and `newEvent` is very confusing for newcomers that read the testing documentation, we remove it entirely, and instead assume most, if not all, newcomers will run tests in Chrome as it is the default. Fixes angular#23370
Because PhantomJS has been deprecated since March 2018, and `newEvent` is very confusing for newcomers that read the testing documentation, we remove it entirely, and instead assume most, if not all, newcomers will run tests in Chrome as it is the default. Fixes angular#23370
Because PhantomJS has been deprecated since March 2018, and `newEvent` is very confusing for newcomers that read the testing documentation, we remove it entirely, and instead assume most, if not all, newcomers will run tests in Chrome as it is the default. Fixes angular#23370
I'm submitting a...
Current behavior
In Testing Section, there is a typo.
The example in Change an input value with dispatchEvent() section, in the test is showing
nameInput.dispatchEvent(newEvent('input'));
Expected behavior
nameInput.dispatchEvent(new Event('input'));
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment