question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explain the newEvent helper function used in the live example of Testing docs

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
brandonrobertscommented, Apr 23, 2018

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.

3reactions
maxterrycommented, Aug 16, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found