mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-12 17:45:49 +08:00
Disallow equality assertions with boolean, null, and undefined.
Require the more descriptive `assert.isTrue`, `assert.isFalse`, `assert.isNull`, `assert.isUndefined`, and friends instead, which also produce a more meaningful error message than the generic `assert.strictEqual`, `assert.deepEqual`, and friends. Bug: 386335487 Change-Id: Ic58a07381196c358a43857b53364d74076e9c7e8 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6113833 Reviewed-by: Changhao Han <changhaohan@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
e5afea232d
commit
5cb9f987f7
@@ -18,7 +18,7 @@ describe('JavaScriptMetadata', () => {
|
||||
|
||||
it('does not retrieve native signatures that are bound to an instance', () => {
|
||||
const signatures = metadata.signaturesForNativeFunction('find');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
|
||||
describe('with static methods', () => {
|
||||
@@ -29,12 +29,12 @@ describe('JavaScriptMetadata', () => {
|
||||
|
||||
it('does not retrieve methods that are bound to an instance', () => {
|
||||
const signatures = metadata.signaturesForStaticMethod('includes', 'Array');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
|
||||
it('handles a non-existing class', () => {
|
||||
const signatures = metadata.signaturesForStaticMethod('includes', 'bogus');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,17 +46,17 @@ describe('JavaScriptMetadata', () => {
|
||||
|
||||
it('does not retrieve methods that are unbound', () => {
|
||||
const signatures = metadata.signaturesForInstanceMethod('webkitRequestFullScreen', 'window');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
|
||||
it('does not retrieve static methods', () => {
|
||||
const signatures = metadata.signaturesForInstanceMethod('from', 'Array');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
|
||||
it('handles a non-existing class', () => {
|
||||
const signatures = metadata.signaturesForInstanceMethod('from', 'Sheep');
|
||||
assert.deepEqual(signatures, null);
|
||||
assert.isNull(signatures);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user