Commit 6fa36f2b authored by Lidan Hifi's avatar Lidan Hifi

fixed es6 syntax in spec file

parent f07e731f
...@@ -2,7 +2,7 @@ let expect = require("chai").use(require("sinon-chai")).expect; ...@@ -2,7 +2,7 @@ let expect = require("chai").use(require("sinon-chai")).expect;
let proxyquire = require("proxyquire"); let proxyquire = require("proxyquire");
let sinon = require("sinon"); let sinon = require("sinon");
describe("NotificationsIOS", function () { describe("NotificationsIOS", () => {
let deviceEvents = [ let deviceEvents = [
"notificationReceivedForeground", "notificationReceivedForeground",
"notificationReceivedBackground", "notificationReceivedBackground",
...@@ -44,25 +44,25 @@ describe("NotificationsIOS", function () { ...@@ -44,25 +44,25 @@ describe("NotificationsIOS", function () {
notificationIOS = null; notificationIOS = null;
}); });
describe("Add Event Listener", function () { describe("Add Event Listener", () => {
deviceEvents.forEach(function(event) { deviceEvents.forEach(event => {
it(`should subscribe the given handler to device event: ${event}`, function () { it(`should subscribe the given handler to device event: ${event}`, () => {
notificationIOS.addEventListener(event, someHandler); notificationIOS.addEventListener(event, someHandler);
expect(addEventListenerSpy).to.have.been.calledWith(event, sinon.match.func); 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); notificationIOS.addEventListener("someUnsupportedEvent", someHandler);
expect(addEventListenerSpy).to.not.have.been.called; expect(addEventListenerSpy).to.not.have.been.called;
}); });
}); });
describe("Remove Event Listener", function () { describe("Remove Event Listener", () => {
deviceEvents.forEach(function(event) { deviceEvents.forEach(event => {
it(`should unsubscribe the given handler from device event: ${event}`, function () { it(`should unsubscribe the given handler from device event: ${event}`, () => {
notificationIOS.addEventListener(event, someHandler); notificationIOS.addEventListener(event, someHandler);
notificationIOS.removeEventListener(event, someHandler); notificationIOS.removeEventListener(event, someHandler);
...@@ -70,7 +70,7 @@ describe("NotificationsIOS", function () { ...@@ -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"; let someUnsupportedEvent = "someUnsupportedEvent";
notificationIOS.addEventListener(someUnsupportedEvent, someHandler); notificationIOS.addEventListener(someUnsupportedEvent, someHandler);
notificationIOS.removeEventListener(someUnsupportedEvent, someHandler); notificationIOS.removeEventListener(someUnsupportedEvent, someHandler);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment