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;
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);
......
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