How to use pusher method in ava

Best JavaScript code snippet using ava

pusher_spec.js

Source:pusher_spec.js Github

copy

Full Screen

1var TestEnv = require('testenv');2var Util = require('core/util').default;3var Collections = require('core/utils/collections');4var Logger = require('core/logger').default;5var Defaults = require('core/defaults').default;6var DefaultConfig = require('core/config');7var TimelineSender = require('core/timeline/timeline_sender').default;8var Pusher = require('core/pusher').default;9var Mocks = require('../../helpers/mocks');10var Factory = require('core/utils/factory').default;11var Runtime = require('runtime').default;12describe("Pusher", function() {13 var _isReady, _instances, _logToConsole;14 switch (TestEnv) {15 case "worker":16 case "node":17 var timelineTransport = "xhr";18 break;19 case "web":20 var timelineTransport = "jsonp";21 break22 default:23 throw("Please specify the test environment as an external.")24 }25 beforeEach(function() {26 _instances = Pusher.instances;27 _isReady = Pusher.isReady;28 _logToConsole = Pusher.logToConsole;29 Pusher.isReady = false;30 Pusher.instances = [];31 spyOn(Runtime, "getDefaultStrategy").andCallFake(function() {32 return Mocks.getStrategy(true);33 });34 spyOn(Factory, "createConnectionManager").andCallFake(function(key, options, config) {35 var manager = Mocks.getConnectionManager();36 manager.key = key;37 manager.options = options;38 manager.config = config;39 return manager;40 });41 spyOn(Factory, "createChannel").andCallFake(function(name, _) {42 return Mocks.getChannel(name);43 });44 if (TestEnv === "web") {45 spyOn(Runtime, "getDocument").andReturn({46 location: {47 protocol: "http:"48 }49 });50 }51 });52 afterEach(function() {53 Pusher.instances = _instances;54 Pusher.isReady = _isReady;55 Pusher.logToConsole = _logToConsole;56 });57 describe("app key validation", function() {58 it("should throw on a null key", function() {59 expect(function() { new Pusher(null) }).toThrow("You must pass your app key when you instantiate Pusher.");60 });61 it("should throw on an undefined key", function() {62 expect(function() { new Pusher() }).toThrow("You must pass your app key when you instantiate Pusher.");63 });64 it("should allow a hex key", function() {65 spyOn(Logger, "warn");66 var pusher = new Pusher("1234567890abcdef", { cluster: "mt1" });67 expect(Logger.warn).not.toHaveBeenCalled();68 });69 it("should warn if no cluster is supplied", function() {70 spyOn(Logger, "warn");71 var pusher = new Pusher("1234567890abcdef");72 expect(Logger.warn).toHaveBeenCalled();73 });74 it("should not warn if no cluster is supplied if wsHost or httpHost are supplied", function() {75 spyOn(Logger, "warn");76 var wsPusher = new Pusher("1234567890abcdef", { wsHost: 'example.com' });77 var httpPusher = new Pusher("1234567890abcdef", { httpHost: 'example.com' });78 expect(Logger.warn).not.toHaveBeenCalled();79 expect(Logger.warn).not.toHaveBeenCalled();80 });81 });82 describe("after construction", function() {83 var pusher;84 beforeEach(function() {85 pusher = new Pusher("foo");86 });87 it("should create a timeline with the correct key", function() {88 expect(pusher.timeline.key).toEqual("foo");89 });90 it("should create a timeline with a session id", function() {91 expect(pusher.timeline.session).toEqual(pusher.sessionID);92 });93 it("should pass the cluster name to the timeline", function() {94 var pusher = new Pusher("foo");95 expect(pusher.timeline.options.cluster).toBe(Defaults.cluster);96 pusher = new Pusher("foo", { cluster: "spec" });97 expect(pusher.timeline.options.cluster).toEqual("spec");98 });99 it("should pass a feature list to the timeline", function() {100 spyOn(Pusher, "getClientFeatures").andReturn(["foo", "bar"]);101 var pusher = new Pusher("foo");102 expect(pusher.timeline.options.features).toEqual(["foo", "bar"]);103 });104 it("should pass the version number to the timeline", function() {105 expect(pusher.timeline.options.version).toEqual(Defaults.VERSION);106 });107 it("should pass per-connection timeline params", function() {108 pusher = new Pusher("foo", { timelineParams: { horse: true } });109 expect(pusher.timeline.options.params).toEqual({ horse: true });110 });111 it("should find subscribed channels", function() {112 var channel = pusher.subscribe("chan");113 expect(pusher.channel("chan")).toBe(channel);114 });115 it("should not find unsubscribed channels", function() {116 expect(pusher.channel("chan")).toBe(undefined);117 pusher.subscribe("chan");118 pusher.unsubscribe("chan");119 expect(pusher.channel("chan")).toBe(undefined);120 });121 describe("TLS", function() {122 it("should be off by default", function() {123 expect(pusher.shouldUseTLS()).toBe(true);124 });125 it("should be off when 'forceTLS' parameter is passed", function() {126 var pusher = new Pusher("foo", { forceTLS: false });127 expect(pusher.shouldUseTLS()).toBe(false);128 });129 if (TestEnv === "web") {130 it("should be on when using https", function() {131 Runtime.getDocument.andReturn({132 location: {133 protocol: "https:"134 }135 });136 var pusher = new Pusher("foo", { forceTLS: false });137 expect(pusher.shouldUseTLS()).toBe(true);138 });139 }140 });141 describe("with getStrategy function", function() {142 it("should construct a strategy instance", function() {143 var strategy = pusher.connection.options.getStrategy();144 expect(strategy.isSupported).toEqual(jasmine.any(Function));145 expect(strategy.connect).toEqual(jasmine.any(Function));146 });147 it("should pass config and options to the strategy builder", function() {148 var config = DefaultConfig.getConfig({});149 var options = { useTLS: true }150 var getStrategy = pusher.connection.options.getStrategy;151 getStrategy(options)152 expect(Runtime.getDefaultStrategy).toHaveBeenCalledWith(153 pusher.config,154 options,155 jasmine.any(Function),156 )157 });158 });159 describe("connection manager", function() {160 it("should have the right key", function() {161 var pusher = new Pusher("beef");162 expect(pusher.connection.key).toEqual("beef");163 });164 it("should have default timeouts", function() {165 var pusher = new Pusher("foo");166 var options = pusher.connection.options;167 expect(options.activityTimeout).toEqual(Defaults.activityTimeout);168 expect(options.pongTimeout).toEqual(Defaults.pongTimeout);169 expect(options.unavailableTimeout).toEqual(Defaults.unavailableTimeout);170 });171 it("should use user-specified timeouts", function() {172 var pusher = new Pusher("foo", {173 activityTimeout: 123,174 pongTimeout: 456,175 unavailableTimeout: 789176 });177 var options = pusher.connection.options;178 expect(options.activityTimeout).toEqual(123);179 expect(options.pongTimeout).toEqual(456);180 expect(options.unavailableTimeout).toEqual(789);181 });182 });183 });184 describe(".ready", function() {185 it("should start connection attempts for instances", function() {186 var pusher = new Pusher("01234567890abcdef");187 spyOn(pusher, "connect");188 expect(pusher.connect).not.toHaveBeenCalled();189 Pusher.ready();190 expect(pusher.connect).toHaveBeenCalled();191 });192 });193 describe("#connect", function() {194 it("should call connect on connection manager", function() {195 var pusher = new Pusher("foo");196 pusher.connect();197 expect(pusher.connection.connect).toHaveBeenCalledWith();198 });199 });200 describe("after connecting", function() {201 beforeEach(function() {202 pusher = new Pusher("foo");203 pusher.connect();204 pusher.connection.state = "connected";205 pusher.connection.emit("connected");206 });207 it("should subscribe to all channels", function() {208 var pusher = new Pusher("foo");209 var subscribedChannels = {210 "channel1": pusher.subscribe("channel1"),211 "channel2": pusher.subscribe("channel2")212 };213 expect(subscribedChannels.channel1.subscribe).not.toHaveBeenCalled();214 expect(subscribedChannels.channel2.subscribe).not.toHaveBeenCalled();215 pusher.connect();216 pusher.connection.state = "connected";217 pusher.connection.emit("connected");218 expect(subscribedChannels.channel1.subscribe).toHaveBeenCalled();219 expect(subscribedChannels.channel2.subscribe).toHaveBeenCalled();220 });221 it("should send events via the connection manager", function() {222 pusher.send_event("event", { key: "value" }, "channel");223 expect(pusher.connection.send_event).toHaveBeenCalledWith(224 "event", { key: "value" }, "channel"225 );226 });227 describe("#subscribe", function() {228 it("should return the same channel object for subsequent calls", function() {229 var channel = pusher.subscribe("xxx");230 expect(channel.name).toEqual("xxx");231 expect(pusher.subscribe("xxx")).toBe(channel);232 });233 it("should subscribe the channel", function() {234 var channel = pusher.subscribe("xxx");235 expect(channel.subscribe).toHaveBeenCalled();236 });237 it("should reinstate cancelled pending subscription", function() {238 var channel = pusher.subscribe("xxx");239 channel.subscriptionPending = true;240 channel.subscriptionCancelled = true;241 pusher.subscribe("xxx");242 expect(channel.reinstateSubscription).toHaveBeenCalled();243 })244 });245 describe("#unsubscribe", function() {246 it("should unsubscribe the channel if subscription is not pending", function() {247 var channel = pusher.subscribe("yyy");248 expect(channel.unsubscribe).not.toHaveBeenCalled();249 pusher.unsubscribe("yyy");250 expect(channel.unsubscribe).toHaveBeenCalled();251 });252 it("should remove the channel from .channels if subscription is not pending", function () {253 var channel = pusher.subscribe("yyy");254 expect(pusher.channel("yyy")).toBe(channel);255 pusher.unsubscribe("yyy");256 expect(pusher.channel("yyy")).toBe(undefined);257 });258 it("should delay unsubscription if the subscription is pending", function () {259 var channel = pusher.subscribe("yyy");260 channel.subscriptionPending = true;261 pusher.unsubscribe("yyy");262 expect(pusher.channel("yyy")).toBe(channel);263 expect(channel.unsubscribe).not.toHaveBeenCalled();264 expect(channel.cancelSubscription).toHaveBeenCalled();265 })266 });267 });268 describe("on message", function() {269 var pusher;270 beforeEach(function() {271 pusher = new Pusher("foo");272 });273 it("should pass events to their channels", function() {274 var channel = pusher.subscribe("chan");275 pusher.connection.emit("message", {276 channel: "chan",277 event: "event",278 data: { key: "value" }279 });280 expect(channel.handleEvent).toHaveBeenCalledWith({281 channel: "chan",282 event: "event",283 data: { key: "value" },284 });285 });286 it("should not publish events to other channels", function() {287 var channel = pusher.subscribe("chan");288 var onEvent = jasmine.createSpy("onEvent");289 channel.bind("event", onEvent);290 pusher.connection.emit("message", {291 channel: "different",292 event: "event",293 data: {}294 });295 expect(onEvent).not.toHaveBeenCalled();296 });297 it("should publish per-channel events globally (deprecated)", function() {298 var onEvent = jasmine.createSpy("onEvent");299 pusher.bind("event", onEvent);300 pusher.connection.emit("message", {301 channel: "chan",302 event: "event",303 data: { key: "value" }304 });305 expect(onEvent).toHaveBeenCalledWith({ key: "value" });306 });307 it("should publish global events (deprecated)", function() {308 var onEvent = jasmine.createSpy("onEvent");309 var onAllEvents = jasmine.createSpy("onAllEvents");310 pusher.bind("global", onEvent);311 pusher.bind_global(onAllEvents);312 pusher.connection.emit("message", {313 event: "global",314 data: "data"315 });316 expect(onEvent).toHaveBeenCalledWith("data");317 expect(onAllEvents).toHaveBeenCalledWith("global", "data");318 });319 it("should not publish internal events", function() {320 var onEvent = jasmine.createSpy("onEvent");321 pusher.bind("pusher_internal:test", onEvent);322 pusher.connection.emit("message", {323 event: "pusher_internal:test",324 data: "data"325 });326 expect(onEvent).not.toHaveBeenCalled();327 });328 });329 describe("#unbind", function() {330 it("should allow a globally bound callback to be removed", function() {331 var onEvent = jasmine.createSpy("onEvent");332 pusher.bind("event", onEvent);333 pusher.unbind("event", onEvent);334 pusher.connection.emit("message", {335 channel: "chan",336 event: "event",337 data: { key: "value" }338 });339 expect(onEvent).not.toHaveBeenCalled();340 });341 });342 describe("#disconnect", function() {343 it("should call disconnect on connection manager", function() {344 var pusher = new Pusher("foo");345 pusher.disconnect();346 expect(pusher.connection.disconnect).toHaveBeenCalledWith();347 });348 });349 describe("after disconnecting", function() {350 it("should disconnect channels", function() {351 var pusher = new Pusher("foo");352 var channel1 = pusher.subscribe("channel1");353 var channel2 = pusher.subscribe("channel2");354 pusher.connection.state = "disconnected";355 pusher.connection.emit("disconnected");356 expect(channel1.disconnect).toHaveBeenCalledWith();357 expect(channel2.disconnect).toHaveBeenCalledWith();358 });359 });360 describe("on error", function() {361 it("should log a warning to console", function() {362 var pusher = new Pusher("foo");363 spyOn(Logger, "warn");364 pusher.connection.emit("error", "something");365 expect(Logger.warn).toHaveBeenCalledWith("something");366 });367 });368 describe("metrics", function() {369 var timelineSender;370 beforeEach(function() {371 jasmine.Clock.useMock();372 timelineSender = Mocks.getTimelineSender();373 spyOn(Factory, "createTimelineSender").andReturn(timelineSender);374 });375 it("should be sent to stats.pusher.com", function() {376 var pusher = new Pusher("foo", { enableStats: true });377 expect(Factory.createTimelineSender.calls.length).toEqual(1);378 expect(Factory.createTimelineSender).toHaveBeenCalledWith(379 pusher.timeline, { host: "stats.pusher.com", path: "/timeline/v2/" + timelineTransport }380 );381 });382 it("should be sent to a hostname specified in constructor options", function() {383 var pusher = new Pusher("foo", {384 statsHost: "example.com",385 enableStats: true,386 });387 expect(Factory.createTimelineSender).toHaveBeenCalledWith(388 pusher.timeline, { host: "example.com", path: "/timeline/v2/" + timelineTransport }389 );390 });391 it("should not be sent by default", function() {392 var pusher = new Pusher("foo");393 pusher.connect();394 pusher.connection.options.timeline.info({});395 jasmine.Clock.tick(1000000);396 expect(timelineSender.send.calls.length).toEqual(0);397 });398 it("should be sent if disableStats set to false", function() {399 var pusher = new Pusher("foo", { disableStats: false });400 pusher.connect();401 pusher.connection.options.timeline.info({});402 expect(Factory.createTimelineSender.calls.length).toEqual(1);403 expect(Factory.createTimelineSender).toHaveBeenCalledWith(404 pusher.timeline, { host: "stats.pusher.com", path: "/timeline/v2/" + timelineTransport }405 );406 });407 it("should honour enableStats setting if enableStats and disableStats set", function() {408 var pusher = new Pusher("foo", { disableStats: true, enableStats: true });409 pusher.connect();410 pusher.connection.options.timeline.info({});411 expect(Factory.createTimelineSender.calls.length).toEqual(1);412 expect(Factory.createTimelineSender).toHaveBeenCalledWith(413 pusher.timeline, { host: "stats.pusher.com", path: "/timeline/v2/" + timelineTransport }414 );415 });416 it("should not be sent before calling connect", function() {417 var pusher = new Pusher("foo", { enableStats: true });418 pusher.connection.options.timeline.info({});419 jasmine.Clock.tick(1000000);420 expect(timelineSender.send.calls.length).toEqual(0);421 });422 it("should be sent every 60 seconds after calling connect", function() {423 var pusher = new Pusher("foo", { enableStats: true });424 pusher.connect();425 expect(Factory.createTimelineSender.calls.length).toEqual(1);426 pusher.connection.options.timeline.info({});427 jasmine.Clock.tick(59999);428 expect(timelineSender.send.calls.length).toEqual(0);429 jasmine.Clock.tick(1);430 expect(timelineSender.send.calls.length).toEqual(1);431 jasmine.Clock.tick(60000);432 expect(timelineSender.send.calls.length).toEqual(2);433 });434 it("should be sent after connecting", function() {435 var pusher = new Pusher("foo", { enableStats: true });436 pusher.connect();437 pusher.connection.options.timeline.info({});438 pusher.connection.state = "connected";439 pusher.connection.emit("connected");440 expect(timelineSender.send.calls.length).toEqual(1);441 });442 it("should not be sent after disconnecting", function() {443 var pusher = new Pusher("foo", { enableStats: true });444 pusher.connect();445 pusher.disconnect();446 pusher.connection.options.timeline.info({});447 jasmine.Clock.tick(1000000);448 expect(timelineSender.send.calls.length).toEqual(0);449 });450 it("should be sent without TLS if connection is not using TLS", function() {451 var pusher = new Pusher("foo", { enableStats: true });452 pusher.connection.isUsingTLS.andReturn(false);453 pusher.connect();454 pusher.connection.options.timeline.info({});455 pusher.connection.state = "connected";456 pusher.connection.emit("connected");457 expect(timelineSender.send).toHaveBeenCalledWith(false);458 });459 it("should be sent with TLS if connection is over TLS", function() {460 var pusher = new Pusher("foo", { enableStats: true });461 pusher.connection.isUsingTLS.andReturn(true);462 pusher.connect();463 pusher.connection.options.timeline.info({});464 pusher.connection.state = "connected";465 pusher.connection.emit("connected");466 expect(timelineSender.send).toHaveBeenCalledWith(true);467 });468 });...

Full Screen

Full Screen

jquery.pusher.js

Source:jquery.pusher.js Github

copy

Full Screen

...56$(function() {57 var pluginScriptTag = $("script[src$='jquery.pusher.js']");58 var key = pluginScriptTag.attr("data-pusher-app-key");59 if(key) {60 $(document.body).pusher(key);61 }62});63/** @private */64$.fn.pusher._instances = {};65$.fn.pusher.getPusher = function(appKey) {66 appKey = appKey || this.pusherAppKey;67 var jqInstance = $.fn.pusher._instances[appKey];68 var pusherInstance = jqInstance.getPusher();69 return pusherInstance;70};71/** @private */72$.fn.pusher.jqPusher = function(appKey, settings, els){73 74 var self = this;...

Full Screen

Full Screen

extension.js

Source:extension.js Github

copy

Full Screen

1'use strict';2System.register('flarum/pusher/components/PusherSettingsModal', ['flarum/components/SettingsModal'], function (_export, _context) {3 "use strict";4 var SettingsModal, PusherSettingsModal;5 return {6 setters: [function (_flarumComponentsSettingsModal) {7 SettingsModal = _flarumComponentsSettingsModal.default;8 }],9 execute: function () {10 PusherSettingsModal = function (_SettingsModal) {11 babelHelpers.inherits(PusherSettingsModal, _SettingsModal);12 function PusherSettingsModal() {13 babelHelpers.classCallCheck(this, PusherSettingsModal);14 return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(PusherSettingsModal).apply(this, arguments));15 }16 babelHelpers.createClass(PusherSettingsModal, [{17 key: 'className',18 value: function className() {19 return 'PusherSettingsModal Modal--small';20 }21 }, {22 key: 'title',23 value: function title() {24 return app.translator.trans('flarum-pusher.admin.pusher_settings.title');25 }26 }, {27 key: 'form',28 value: function form() {29 return [m(30 'div',31 { className: 'Form-group' },32 m(33 'label',34 null,35 app.translator.trans('flarum-pusher.admin.pusher_settings.app_id_label')36 ),37 m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_id') })38 ), m(39 'div',40 { className: 'Form-group' },41 m(42 'label',43 null,44 app.translator.trans('flarum-pusher.admin.pusher_settings.app_key_label')45 ),46 m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_key') })47 ), m(48 'div',49 { className: 'Form-group' },50 m(51 'label',52 null,53 app.translator.trans('flarum-pusher.admin.pusher_settings.app_secret_label')54 ),55 m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_secret') })56 ), m(57 'div',58 { className: 'Form-group' },59 m(60 'label',61 null,62 app.translator.trans('flarum-pusher.admin.pusher_settings.app_cluster_label')63 ),64 m('input', { className: 'FormControl', bidi: this.setting('flarum-pusher.app_cluster') })65 )];66 }67 }]);68 return PusherSettingsModal;69 }(SettingsModal);70 _export('default', PusherSettingsModal);71 }72 };73});;74'use strict';75System.register('flarum/pusher/main', ['flarum/extend', 'flarum/app', 'flarum/pusher/components/PusherSettingsModal'], function (_export, _context) {76 "use strict";77 var extend, app, PusherSettingsModal;78 return {79 setters: [function (_flarumExtend) {80 extend = _flarumExtend.extend;81 }, function (_flarumApp) {82 app = _flarumApp.default;83 }, function (_flarumPusherComponentsPusherSettingsModal) {84 PusherSettingsModal = _flarumPusherComponentsPusherSettingsModal.default;85 }],86 execute: function () {87 app.initializers.add('flarum-pusher', function (app) {88 app.extensionSettings['flarum-pusher'] = function () {89 return app.modal.show(new PusherSettingsModal());90 };91 });92 }93 };...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var pusher = require('./pusher');2var express = require('express');3var app = express();4var bodyParser = require('body-parser');5var path = require('path');6app.use(bodyParser.urlencoded({ extended: true }));7app.use(bodyParser.json());8app.set('views', path.join(__dirname, 'views'));9app.set('view engine', 'jade');10app.get('/', function (req, res) {11 res.render('index');12});13app.post('/pusher/auth', function(req, res) {14 var socketId = req.body.socket_id;15 var channel = req.body.channel_name;16 var auth = pusher.authenticate(socketId, channel);17 res.send(auth);18});19app.listen(3000, function () {20 console.log('Example app listening on port 3000!');21});

Full Screen

Using AI Code Generation

copy

Full Screen

1const test = require('ava');2const {pusher} = require('../src/pusher');3test('pusher', t => {4 const input = [1,2,3];5 const output = pusher(input, 4);6 t.deepEqual(output, [1,2,3,4]);7 t.deepEqual(input, [1,2,3]);8});9const test = require('ava');10const {popper} = require('../src/popper');11test('popper', t => {12 const input = [1,2,3];13 const output = popper(input);14 t.deepEqual(output, [1,2]);15 t.deepEqual(input, [1,2]);16});17const test = require('ava');18const {unshift} = require('../src/unshift');19test('unshift', t => {20 const input = [1,2,3];21 const output = unshift(input, 0);22 t.deepEqual(output, [0,1,2,3]);23 t.deepEqual(input, [0,1,2,3]);24});25const test = require('ava');26const {shift} = require('../src/shift');27test('shift', t => {28 const input = [1,2,3];29 const output = shift(input);30 t.deepEqual(output, [2,3]);31 t.deepEqual(input, [2,3]);32});33const test = require('ava');34const {concat} = require('../src/concat');35test('concat', t => {36 const input = [1,2,3];37 const output = concat(input, [4,5,6]);38 t.deepEqual(output, [1,2,3,4,5,6]);39 t.deepEqual(input, [1,2,3]);40});41const test = require('ava');42const {slice} = require('../src/slice');43test('slice', t => {44 const input = [1,2,3,4,5];45 const output = slice(input, 1, 3);

Full Screen

Using AI Code Generation

copy

Full Screen

1var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');2var channel = pusher.subscribe('my-channel');3channel.bind('my-event', function(data) {4 alert(data.message);5});6var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');7var channel = pusher.subscribe('my-channel');8channel.bind('my-event', function(data) {9 alert(data.message);10});11var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');12var channel = pusher.subscribe('my-channel');13channel.bind('my-event', function(data) {14 alert(data.message);15});16var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');17var channel = pusher.subscribe('my-channel');18channel.bind('my-event', function(data) {19 alert(data.message);20});21var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');22var channel = pusher.subscribe('my-channel');23channel.bind('my-event', function(data) {24 alert(data.message);25});26var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');27var channel = pusher.subscribe('my-channel');28channel.bind('my-event', function(data) {29 alert(data.message);30});31var pusher = new Pusher('3c1f2d8e9f9e2b6f7b01');32var channel = pusher.subscribe('my-channel');33channel.bind('my-event', function(data) {34 alert(data.message);35});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ava automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful