You are here

public function JavascriptErrorsSuppressionTest::testJavascriptErrors in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsSuppressionTest.php \Drupal\FunctionalJavascriptTests\JavascriptErrorsSuppressionTest::testJavascriptErrors()

Tests that JavaScript console errors can be suppressed.

File

core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsSuppressionTest.php, line 30

Class

JavascriptErrorsSuppressionTest
Tests that Drupal.throwError can be suppressed to allow a test to pass.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function testJavascriptErrors() : void {

  // Visit page that will throw a JavaScript console error.
  $this
    ->drupalGet('js_errors_test');

  // Ensure that errors from previous page loads will be
  // detected.
  $this
    ->drupalGet('user');
}