Explain the newEvent helper function used in the live example of Testing docs
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[X] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
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
Angular version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Test Documentation in Software Testing (Example) - Guru99
It helps the testing team to estimate testing effort needed, test coverage, resource tracking, execution progress, etc. It is a complete suite ...
Read more >Component testing scenarios - Angular
The asyncData helper is a utility function that you'll have to write yourself, or copy this one from the sample code. testing/async-observable-helpers.ts
Read more >Functional Testing: A Complete Guide with Types and Example
An In-Depth Comprehensive Functional Testing Tutorial with Types, Techniques, and Examples: What is Functional Testing?
Read more >unittest — Unit testing framework — Python 3.11.1 ...
A new TestCase instance is created as a unique test fixture used to execute each individual test method. Thus setUp() , tearDown() ,...
Read more >Manual Testing for Beginners | BrowserStack
This tutorial will provide a detailed guide on manual testing for beginners. It will also explain stages and methods used in manual testing....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @keilla! The code used there is not a typo. There is a
newEvent
helper function that’s in the live example, but not explained in the documentation. I think it would be valuable to show it though to avoid confusion.So far haven’t been able to find any information on this random, basically un-duck-duck-go-able
newEvent
function that’s mentioned, but never imported or explained, in the docs.