Fixed browser platform to pass tests and combined tests
diff --git a/plugin.xml b/plugin.xml
index 51df391..73674a2 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -141,7 +141,8 @@
<!-- browser -->
<platform name="browser">
<js-module src="src/browser/Vibration.js" name="Vibration">
- <clobbers target="navigator" />
+ <merges target="navigator.notification" />
+ <merges target="navigator" />
</js-module>
</platform>
diff --git a/tests/tests.js b/tests/tests.js
index 3ab43d1..79aff30 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -22,13 +22,13 @@
exports.defineAutoTests = function () {
describe('Vibration (navigator.notification.vibrate)', function () {
- it("navigator.notification should exist", function () {
+ it("navigator.notification should exist with vibrate function", function () {
expect(navigator.notification).toBeDefined();
- });
-
- it("should contain a vibrate function", function () {
expect(typeof navigator.notification.vibrate).toBeDefined();
expect(typeof navigator.notification.vibrate).toBe("function");
+
+ if (cordova.platformId == "browser")
+ expect(navigator.notification.vibrate(0)).toBe(false);
});
});
};