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.

bug: Sanity checks run in test environement

See original GitHub issue

As I explained in comment on PR ( https://github.com/angular/components/pull/23289 ) I have a lot of warnings coming from angular material sanity checks during my unit test runs, what makes the output unreadable. @jelbourn advised me to open an issue because sanity checks should not run in test environment.

Thanks for your help !

Steps to reproduce:

  1. Fork https://github.com/eweap/angular-material-warn
  2. Run yarn install then run test with yarn nx test ui to run the test for the ui lib (its a nrwl/nx workspace)

Expected Behavior

What behavior were you expecting to see? No warning should be display during the test run

Actual Behavior

What behavior did you actually see? A warning is displayed:

console.warn
      Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming

      at MatCommonModule.Object.<anonymous>.MatCommonModule._checkThemeIsPresent (../../../src/material/core/common-behaviors/common-module.ts:144:15)
      at new MatCommonModule (../../../src/material/core/common-behaviors/common-module.ts:81:12)
      at Object.MatCommonModule_Factory [as factory] (../../node_modules/@angular/material/bundles/material-core.umd.js:189:69)
      at R3Injector.Object.<anonymous>.R3Injector.hydrate (../../../packages/core/src/di/r3_injector.ts:416:29)
      at R3Injector.Object.<anonymous>.R3Injector.get (../../../packages/core/src/di/r3_injector.ts:211:23)
      at ../../../packages/core/src/di/r3_injector.ts:247:51
          at Set.forEach (<anonymous>)
      at R3Injector.Object.<anonymous>.R3Injector._resolveInjectorDefTypes (../../../packages/core/src/di/r3_injector.ts:247:27)

Environment

  • Angular: 12.2.1
  • CDK/Material: 12.2.1
  • Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
jelbourncommented, Aug 13, 2021

@crisbeto it looks like we should update our test env check to look for jest

3reactions
michaelfaithcommented, Nov 3, 2021

fingers crossed this makes it into 13 (also, hurrah for 13 🎉)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sanity checks: Easy Guide For Beginners | Unext Jigsaw
Running sanity checks is a key factor in the data-wrangling process. Sanity checks enable you to check whether the environment is functioning ......
Read more >
Sanity Testing – Quick Tutorial on How to do Sanity Test
Sanity testing is a tool to tell whether your software release meets the merit to be exhaustively tested or is too flawed to...
Read more >
What is Sanity Testing? Definition of ...
So, the bug is reported by the testing team to the development team to resolve it. When the development team fixes the defect...
Read more >
Sanity Testing Vs. Smoke Testing – Difference Between ...
Smoke Testing verifies the critical functionalities of the system whereas Sanity Testing verifies the new functionality like bug fixes.
Read more >
Sanity check - Wikipedia
In computer science, a sanity test is a very brief run-through of the functionality of a computer program, system, calculation, or other analysis,...
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