From 6fa36f2b833bedf9adb53ca1495e829686761caf Mon Sep 17 00:00:00 2001 From: Lidan Hifi Date: Mon, 11 Apr 2016 20:07:11 +0300 Subject: [PATCH] fixed es6 syntax in spec file --- test/index.ios.spec.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/index.ios.spec.js b/test/index.ios.spec.js index 31133bf..4c83ffb 100644 --- a/test/index.ios.spec.js +++ b/test/index.ios.spec.js @@ -2,7 +2,7 @@ let expect = require("chai").use(require("sinon-chai")).expect; let proxyquire = require("proxyquire"); let sinon = require("sinon"); -describe("NotificationsIOS", function () { +describe("NotificationsIOS", () => { let deviceEvents = [ "notificationReceivedForeground", "notificationReceivedBackground", @@ -44,25 +44,25 @@ describe("NotificationsIOS", function () { notificationIOS = null; }); - describe("Add Event Listener", function () { - deviceEvents.forEach(function(event) { - it(`should subscribe the given handler to device event: ${event}`, function () { + describe("Add Event Listener", () => { + deviceEvents.forEach(event => { + it(`should subscribe the given handler to device event: ${event}`, () => { notificationIOS.addEventListener(event, someHandler); expect(addEventListenerSpy).to.have.been.calledWith(event, sinon.match.func); }); }); - it("should not subscribe to unknown device events", function () { + it("should not subscribe to unknown device events", () => { notificationIOS.addEventListener("someUnsupportedEvent", someHandler); expect(addEventListenerSpy).to.not.have.been.called; }); }); - describe("Remove Event Listener", function () { - deviceEvents.forEach(function(event) { - it(`should unsubscribe the given handler from device event: ${event}`, function () { + describe("Remove Event Listener", () => { + deviceEvents.forEach(event => { + it(`should unsubscribe the given handler from device event: ${event}`, () => { notificationIOS.addEventListener(event, someHandler); notificationIOS.removeEventListener(event, someHandler); @@ -70,7 +70,7 @@ describe("NotificationsIOS", function () { }); }); - it("should not unsubscribe to unknown device events", function () { + it("should not unsubscribe to unknown device events", () => { let someUnsupportedEvent = "someUnsupportedEvent"; notificationIOS.addEventListener(someUnsupportedEvent, someHandler); notificationIOS.removeEventListener(someUnsupportedEvent, someHandler); -- 2.26.2