mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-12 17:45:49 +08:00
Fixed: 1145969 Change-Id: Ibbe9032f31eebf43aefd409ddc3fa5cb0db0f8c1 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2727707 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import {assert} from 'chai';
|
|
|
|
import {expectedErrors} from '../../conductor/hooks.js';
|
|
import {getBrowserAndPages, goToResource, step} from '../../shared/helper.js';
|
|
import {describe, it} from '../../shared/mocha-extensions.js';
|
|
|
|
describe('Assertions', async function() {
|
|
it('console.assert', async () => {
|
|
const {frontend} = getBrowserAndPages();
|
|
await step('Check the evaluation results from console', async () => {
|
|
await frontend.evaluate(() => {
|
|
console.assert(false, 'expected failure 1');
|
|
});
|
|
});
|
|
await goToResource('cross_tool/default.html');
|
|
assert.ok(expectedErrors.some(error => error.includes('expected failure 1')));
|
|
});
|
|
|
|
it('console.error', async () => {
|
|
const {frontend} = getBrowserAndPages();
|
|
await step('Check the evaluation results from console', async () => {
|
|
await frontend.evaluate(() => {
|
|
function foo() {
|
|
console.error('expected failure 2');
|
|
}
|
|
foo();
|
|
});
|
|
});
|
|
await goToResource('cross_tool/default.html');
|
|
assert.ok(expectedErrors.some(error => error.includes('expected failure 2')));
|
|
});
|
|
});
|