From c9cd741aff6acedaedfd2cf96df06a8b46b4826a Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Thu, 14 Jan 2021 01:43:30 +0530 Subject: Throw a `TypeError` instead of the generic `Error` (#32585) * Change from Error to TypeError * Convert the `NAME` to upper case to make the consistency in the error message * Update the remaining tests to be stricter Co-authored-by: XhmikosR --- js/tests/unit/util/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tests/unit/util') diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js index d4b09bf77..00ab44f1e 100644 --- a/js/tests/unit/util/index.spec.js +++ b/js/tests/unit/util/index.spec.js @@ -212,7 +212,7 @@ describe('Util', () => { expect(() => { Util.typeCheckConfig(namePlugin, config, defaultType) - }).toThrow(new Error('COLLAPSE: Option "parent" provided type "number" but expected type "(string|element)".')) + }).toThrowError(TypeError, 'COLLAPSE: Option "parent" provided type "number" but expected type "(string|element)".') }) it('should return null stringified when null is passed', () => { -- cgit v1.2.3