Running tests occasionally fail due to TypeError
See original GitHub issueDetailed description
Describe in detail the issue you’re having.
The tests occasionally fail due to a TypeError as shown below:
HeadlessChrome 0.0.0 (Mac OS X 10.14.6) ERROR
{
"message": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown",
"str": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown"
}
HeadlessChrome 0.0.0 (Mac OS X 10.14.6): Executed 152 of 205 (skipped 13) ERROR (0 secs / 2.421 secs)
HeadlessChrome 0.0.0 (Mac OS X 10.14.6) ERROR
{
"message": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown",
"str": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown"
HeadlessChrome 0.0.0 (Mac OS X 10.14.6): Executed 152 of 205 (skipped 13) ERROR (2.694 secs / 2.421 secs)
The message also sometimes changes:
HeadlessChrome 0.0.0 (Mac OS X 10.14.6) Modal should close modal when escape is pressed FAILED
Uncaught TypeError: Cannot read property 'offsetWidth' of null thrown
HeadlessChrome 0.0.0 (Mac OS X 10.14.6): Executed 99 of 208 (1 FAILED) (skipped 13) (0 secs / 2.424 secs)
HeadlessChrome 0.0.0 (Mac OS X 10.14.6) GridDirective should render a column FAILED
Uncaught TypeError: Cannot read property 'offsetWidth' of null thrown
HeadlessChrome 0.0.0 (Mac OS X 10.14.6): Executed 119 of 208 (1 FAILED) (skipped 7) (0 secs / 2.705 secs)
HeadlessChrome 0.0.0 (Mac OS X 10.14.6) Toggle should change state FAILED
Uncaught TypeError: Cannot read property 'offsetWidth' of null thrown
HeadlessChrome 0.0.0 (Mac OS X 10.14.6): Executed 113 of 208 (1 FAILED) (skipped 9) (0 secs / 2.323 secs)
This comes up sometimes on travis as well:
HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
{
"message": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown",
"str": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown"
}
HeadlessChrome 0.0.0 (Linux 0.0.0): Executed 196 of 214 (skipped 2) ERROR (0 secs / 6.468 secs)
HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
{
"message": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown",
"str": "An error was thrown in afterAll\nUncaught TypeError: Cannot read property 'offsetWidth' of null thrown"
}
e 0.0.0 (Linux 0.0.0): Executed 196 of 214 (skipped 2) ERROR (7.225 secs / 6.468 secs)
npm ERR! Test failed. See above for more details.
The command "npm run lint && npm test" exited with 1.
Is this a feature request (new component, new icon), a bug, or a general issue?
Bug.
What did you expect to happen? What happened instead? What would you like to see changed?
The tests should run without ever coming across an error.
Steps to reproduce the issue
Run the tests multiple times until the error comes up.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Unit Tests Breaking : Uncaught TypeError: Cannot read ...
I am getting this error randomly on different unit tests. It breaks on a different unit test each time tests are ran. However,...
Read more >React and Typescript - Tests are failing due to type error ...
Show activity on this post. Working with React and Typescript is fantastic, but can sometimes result in head-scratching issues.
Read more >Runtime error when running tests: TypeError: Cannot read ...
How do you deal with Runtime error when running tests: TypeError: Cannot read properties of null (reading 'errorMessage') in your Power Apps ...
Read more >Error Messages During Test Execution - LambdaTest
Here is a list of various error messages that may happen during test execution.
Read more >Testing Python Applications with Pytest - Semaphore Tutorial
Pytest stands out among Python testing tools due to its ease of use ... Running the tests at this point should fail with...
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 FreeTop 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
Top GitHub Comments
Ok, it’s been a year, hasn’t come up, closing 🙂
This seems to be an issue with jasmine. After reverting jasmine-core from 3.4.0 to 2.99.0, the errors don’t seem to come up anymore.