]> khamidou — GitHub mirrors - electron.git/commitdiff
Add failing spec for custom error message
authorKevin Sawicki <kevinsawicki@gmail.com>
Fri, 5 Feb 2016 18:48:07 +0000 (10:48 -0800)
committerKevin Sawicki <kevinsawicki@gmail.com>
Tue, 9 Feb 2016 21:24:29 +0000 (13:24 -0800)
spec/webview-spec.js

index 904dfcab6e058bfa8ee7d7d6b2e5a5858bc3647c..faafec73db3bb0e51646531b0216df1118200a9d 100644 (file)
@@ -561,6 +561,17 @@ describe('<webview> tag', function() {
         document.body.appendChild(webview);
       });
     });
+
+    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, 'stop can only be called after the dom-ready event is emitted');
+    });
   });
 
   describe('executeJavaScript', function() {