Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 2b745b0

Browse files
author
Anis Kadri
committed
Issue #110 fixing typo and adding test
1 parent 51e702f commit 2b745b0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

spec/index.spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ describe('phonegap-plugin-contentsync', function() {
5959
});
6060
});
6161

62+
describe('.loadUrl', function() {
63+
it('should raise an error if url is not provided', function() {
64+
expect(function() {
65+
contentSync.loadUrl(null);
66+
}).toThrow();
67+
});
68+
69+
});
70+
6271
describe('ContentSync instance', function() {
6372
describe('cordova.exec', function() {
6473
it('should call cordova.exec on next process tick', function(done) {

www/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ module.exports = {
232232
*/
233233

234234
loadUrl: function(url, cb) {
235-
if(url) {
235+
if(!url) {
236236
throw new Error('URL is required.');
237237
}
238238
exec(cb, cb, 'Sync', 'loadUrl', [url]);

0 commit comments

Comments
 (0)