Skip to content

Commit

Permalink
restored formatting for test files
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmaro committed Jan 27, 2025
1 parent bf82568 commit 25dd9bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions lib/CtrlxDatalayerSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class CtrlxDatalayerSubscription extends EventEmitter {
let es;
try {
es = new EventSource(url, eventSourceInitDict)
} catch (err) {
} catch(err) {
callback(err);
return;
}
Expand Down Expand Up @@ -434,7 +434,7 @@ class CtrlxDatalayerSubscription extends EventEmitter {
// Listener seems not yet to be attached. Retry on next tick.
setTimeout(() => this.emit('update', payload, e.lastEventId), 0);
}
} catch (err) {
} catch(err) {
if (this.listeners('error').length > 0) {
this.emit('error', new Error(`Error parsing update event: ${err.message}`));
}
Expand All @@ -452,7 +452,7 @@ class CtrlxDatalayerSubscription extends EventEmitter {
// Listener seems not yet to be attached. Retry on next tick.
setTimeout(() => this.emit('keepalive', payload, e.lastEventId), 0);
}
} catch (err) {
} catch(err) {
if (this.listeners('error').length > 0) {
this.emit('error', new Error(`Error parsing keepalive event: ${err.message}`));
}
Expand Down
22 changes: 11 additions & 11 deletions test/ctrlx-datalayer-subscribe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const CtrlxCore = require('../lib/CtrlxCore');
/*
* This test group contains test cases for Node-RED nodes.
*/
describe('ctrlx-datalayer-subscribe', function() {
describe('ctrlx-datalayer-subscribe', function () {

function getHostname() {
return process.env.TEST_HOSTNAME || 'localhost';
Expand Down Expand Up @@ -91,9 +91,9 @@ describe('ctrlx-datalayer-subscribe', function() {



describe('ctrlx-datalayer-subscribe: Basic Functionality', function() {
describe('ctrlx-datalayer-subscribe: Basic Functionality', function () {

it('should be loaded as imported by the flow and receive an update', function(done) {
it('should be loaded as imported by the flow and receive an update', function (done) {

let flow = [
{ "id": "h1", "type": "helper" },
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('ctrlx-datalayer-subscribe', function() {



it('should be receive updates within 100ms publishTime', function(done) {
it('should be receive updates within 100ms publishTime', function (done) {

let flow = [
{ "id": "h1", "type": "helper" },
Expand Down Expand Up @@ -210,7 +210,7 @@ describe('ctrlx-datalayer-subscribe', function() {
});


it('should be reconnecting and receive updates after connection got broken', function(done) {
it('should be reconnecting and receive updates after connection got broken', function (done) {

this.timeout(8000);
testServer.subscriptionCount = 0;
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('ctrlx-datalayer-subscribe', function() {



it('should use additional subscription options', function(done) {
it('should use additional subscription options', function (done) {

let flow = [
{ "id": "h1", "type": "helper" },
Expand Down Expand Up @@ -362,7 +362,7 @@ describe('ctrlx-datalayer-subscribe', function() {
});


it('should subscribe dynamically', function(done) {
it('should subscribe dynamically', function (done) {

let flow = [
{ "id": "h1", "type": "helper" },
Expand Down Expand Up @@ -406,7 +406,7 @@ describe('ctrlx-datalayer-subscribe', function() {
});


it('should subscribe dynamically to multiple paths', function(done) {
it('should subscribe dynamically to multiple paths', function (done) {

let flow = [
{ "id": "h1", "type": "helper" },
Expand Down Expand Up @@ -464,7 +464,7 @@ describe('ctrlx-datalayer-subscribe', function() {
});


it('should subscribe a node with strange address', function(done) {
it('should subscribe a node with strange address', function (done) {

let path = 'with/strange/symbols/abc=1;nichts-ist.wahr:("alles[ist]erlaubt")42/x.y.z';

Expand Down Expand Up @@ -514,8 +514,8 @@ describe('ctrlx-datalayer-subscribe', function() {

});

describe('ctrlx-datalayer-subscribe: Error Handling', function() {
it('should handle invalid send json messages', function(done) {
describe('ctrlx-datalayer-subscribe: Error Handling', function () {
it('should handle invalid send json messages', function (done) {

let flow = [
{ "id": "f1", "type": "tab", "label": "Test flow" },
Expand Down

0 comments on commit 25dd9bc

Please sign in to comment.