Skip to content

Commit a4ea1b4

Browse files
committed
lib,test: fix JS linting errors
1 parent 27285b3 commit a4ea1b4

63 files changed

Lines changed: 2619 additions & 2416 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/internal/nsolid_assets.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = ({ heapProfile: _heapProfile,
4444
* } catch (err) {
4545
* // In case an error happens
4646
* }
47-
* @throws Will throw an error if an error happens and no callback was passed.
47+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
4848
* @function profile
4949
* @memberof module:nsolid
5050
*/
@@ -93,7 +93,7 @@ module.exports = ({ heapProfile: _heapProfile,
9393
* }, 1000);
9494
* }
9595
* });
96-
* @throws Will throw an error if an error happens and no callback was passed.
96+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
9797
* @function profileEnd
9898
* @memberof module:nsolid
9999
*/
@@ -138,7 +138,7 @@ module.exports = ({ heapProfile: _heapProfile,
138138
* } catch (err) {
139139
* // In case an error happens
140140
* }
141-
* @throws Will throw an error if an error happens and no callback was passed.
141+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
142142
* @function profile
143143
* @memberof module:nsolid
144144
*/
@@ -193,7 +193,7 @@ module.exports = ({ heapProfile: _heapProfile,
193193
* }, 1000);
194194
* }
195195
* });
196-
* @throws Will throw an error if an error happens and no callback was passed.
196+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
197197
* @function heapProfileEnd
198198
* @memberof module:nsolid
199199
*/
@@ -243,7 +243,7 @@ module.exports = ({ heapProfile: _heapProfile,
243243
* } catch (err) {
244244
* // In case an error happens
245245
* }
246-
* @throws Will throw an error if an error happens and no callback was passed.
246+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
247247
* @function heapSampling
248248
* @memberof module:nsolid
249249
*/
@@ -302,7 +302,7 @@ module.exports = ({ heapProfile: _heapProfile,
302302
* }, 1000);
303303
* }
304304
* });
305-
* @throws Will throw an error if an error happens and no callback was passed.
305+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
306306
* @function heapSamplingEnd
307307
* @memberof module:nsolid
308308
*/
@@ -344,7 +344,7 @@ module.exports = ({ heapProfile: _heapProfile,
344344
* } catch (err) {
345345
* // In case an error happens
346346
* }
347-
* @throws Will throw an error if an error happens and no callback was passed.
347+
* @throws {Error} Will throw an error if an error happens and no callback was passed.
348348
* @function snapshot
349349
* @memberof module:nsolid
350350
*/

lib/nsolid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ function resumeMetrics() {
663663
* started it updates its configuration.
664664
* @param {NSolidConfig} config
665665
* @returns {module:nsolid} the NSolid object.
666-
* @throws exception if the configuration is bogus.
666+
* @throws {Error} exception if the configuration is bogus.
667667
* @alias module:nsolid.start
668668
*/
669669
function start(config/* , agentCb */) {

test/addons/nsolid-custom-command/nsolid-custom-command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function runTest({ args, listener, command, ret, err, status }, done) {
216216
return done();
217217
}
218218

219-
assert.ok(false);
219+
assert.fail('Expected callback to receive a result or error');
220220
})), 0);
221221

222222
assert.strictEqual(binding.customCommand(requestId,

test/addons/nsolid-metrics-stream/nsolid-metrics-stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function test() {
9595
else if (type === KHttpServer)
9696
counters.http_server++;
9797
else
98-
assert(0);
98+
assert.fail(`Unexpected metric type: ${type}`);
9999
});
100100

101101
assert.strictEqual(counters.dns, 20);

test/addons/nsolid-tracing/test-http-agent-close.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
'use strict';
33
const common = require('../../common');
44
const { checkTracesOnExit } = require('../../common/nsolid-traces');
5-
const { fixturesDir } = require('../../common/fixtures');
5+
const fixtures = require('../../common/fixtures');
66
const { setupNSolid } = require('./utils');
77
const assert = require('assert');
88
const http = require('http');
99
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
1010
const binding = require(bindingPath);
1111
const api = require(require.resolve('@opentelemetry/api',
12-
{ paths: [fixturesDir] }));
12+
{ paths: [fixtures.fixturesDir] }));
1313

1414
const expectedTraces = [
1515
{

test/addons/nsolid-tracing/test-otel-basic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const common = require('../../common');
77
const assert = require('assert');
88
const { checkTracesOnExit } = require('../../common/nsolid-traces');
99
const { setupNSolid } = require('./utils');
10-
const { fixturesDir } = require('../../common/fixtures');
10+
const fixtures = require('../../common/fixtures');
1111
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
1212
const binding = require(bindingPath);
1313

1414
const nsolid = require('nsolid');
1515
const api = require(require.resolve('@opentelemetry/api',
16-
{ paths: [fixturesDir] }));
16+
{ paths: [fixtures.fixturesDir] }));
1717

1818
const expectedTraces = [
1919
{

test/addons/nsolid-tracing/test-otel-basic2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
const common = require('../../common');
1212
const { checkTracesOnExit } = require('../../common/nsolid-traces');
1313
const { setupNSolid } = require('./utils');
14-
const { fixturesDir } = require('../../common/fixtures');
14+
const fixtures = require('../../common/fixtures');
1515
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
1616
const binding = require(bindingPath);
1717

1818
const nsolid = require('nsolid');
1919
const api = require(require.resolve('@opentelemetry/api',
20-
{ paths: [fixturesDir] }));
20+
{ paths: [fixtures.fixturesDir] }));
2121

2222
const expectedTraces = [
2323
{

test/addons/nsolid-tracing/test-otel-context-bind-ee.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const assert = require('assert');
1515
const EventEmitter = require('events');
1616
const { checkTracesOnExit } = require('../../common/nsolid-traces');
1717
const { setupNSolid } = require('./utils');
18-
const { fixturesDir } = require('../../common/fixtures');
18+
const fixtures = require('../../common/fixtures');
1919
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
2020
const binding = require(bindingPath);
2121

2222
const nsolid = require('nsolid');
2323
const api = require(require.resolve('@opentelemetry/api',
24-
{ paths: [fixturesDir] }));
24+
{ paths: [fixtures.fixturesDir] }));
2525

2626
const expectedTraces = [
2727
{

test/addons/nsolid-tracing/test-otel-context-bind-fn.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ const common = require('../../common');
1414
const assert = require('assert');
1515
const { checkTracesOnExit } = require('../../common/nsolid-traces');
1616
const { setupNSolid } = require('./utils');
17-
const { fixturesDir } = require('../../common/fixtures');
17+
const fixtures = require('../../common/fixtures');
1818
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
1919
const binding = require(bindingPath);
2020

2121
const nsolid = require('nsolid');
2222
const api = require(require.resolve('@opentelemetry/api',
23-
{ paths: [fixturesDir] }));
23+
{ paths: [fixtures.fixturesDir] }));
2424

2525
const expectedTraces = [
2626
{

test/addons/nsolid-tracing/test-otel-context-enable-disable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const common = require('../../common');
1515
const assert = require('assert');
1616
const { checkTracesOnExit } = require('../../common/nsolid-traces');
1717
const { setupNSolid } = require('./utils');
18-
const { fixturesDir } = require('../../common/fixtures');
18+
const fixtures = require('../../common/fixtures');
1919
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
2020
const binding = require(bindingPath);
2121

2222
const nsolid = require('nsolid');
2323
const api = require(require.resolve('@opentelemetry/api',
24-
{ paths: [fixturesDir] }));
24+
{ paths: [fixtures.fixturesDir] }));
2525

2626
const expectedTraces = [
2727
{

0 commit comments

Comments
 (0)