mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Capture expected warning in registry test. (#4201)
This commit is contained in:
@@ -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.');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user