From 6e39d2f2e25ab6260e14448f5eab8080b824019c Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Thu, 20 Aug 2020 13:57:21 -0700 Subject: [PATCH] Capture expected warning in registry test. (#4201) --- tests/mocha/registry_test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index 44c941a29..f4171197c 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -84,8 +84,13 @@ suite('Registry', function() { }); test('Incorrect Plugin Name', function() { this.options['plugins']['test'] = 'random'; - var testClass = Blockly.registry.getClassFromOptions('test', this.options); + var testClass; + var warnings = captureWarnings(() => { + testClass = Blockly.registry.getClassFromOptions('test', this.options); + }); chai.assert.isNull(testClass); + chai.assert.equal(warnings.length, 1, + 'Expecting 1 warning about no name "random" found.'); }); }); });