Use assert.throws

This commit is contained in:
Kevin Sawicki 2016-02-09 13:53:10 -08:00
parent bad4816976
commit da6ebac742

View file

@ -563,14 +563,9 @@ describe('<webview> tag', function() {
});
it('throws a custom error when an API method is called before the event is emitted', function() {
var readyError = null;
try {
webview.stop();
} catch (error) {
readyError = error;
}
assert.equal(readyError.message, 'Cannot call stop because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.');
assert.throws(function () {
webview.stop()
}, 'Cannot call stop because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.');
});
});