From 78299e2bed70a61a5204ba4cb1886625a7b812e2 Mon Sep 17 00:00:00 2001 From: Annosha Date: Sat, 19 Oct 2024 14:36:15 +0500 Subject: [PATCH] fixed lint errors --- .../node/RequireInTheMiddleSingleton.test.ts | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts index 53d756712f..8c1be21446 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts @@ -53,7 +53,10 @@ describe('RequireInTheMiddleSingleton', () => { 'codecov/lib/codecov.js', onRequireCodecovLibStub ); - requireInTheMiddleSingleton.register('test-non-core-module', onRequireCpxStub); + requireInTheMiddleSingleton.register( + 'test-non-core-module', + onRequireCpxStub + ); requireInTheMiddleSingleton.register( 'test-non-core-module/lib/copy-sync.js', onRequireCpxLibStub @@ -120,8 +123,12 @@ describe('RequireInTheMiddleSingleton', () => { describe('non-core module', () => { describe('AND module name matches', () => { - const baseDir = path.normalize(path.dirname(require.resolve('codecov'))); - const modulePath = path.normalize(path.join('codecov', 'lib', 'codecov.js')); + const baseDir = path.normalize( + path.dirname(require.resolve('codecov')) + ); + const modulePath = path.normalize( + path.join('codecov', 'lib', 'codecov.js') + ); it('should call `onRequire`', () => { const exports = require('codecov'); assert.deepStrictEqual(exports.__ritmOnRequires, ['codecov']); @@ -149,11 +156,15 @@ describe('RequireInTheMiddleSingleton', () => { describe('non-core module with sub-path', () => { describe('AND module name matches', () => { - const baseDir = path.normalize(path.resolve( - path.dirname(require.resolve('test-non-core-module')), - '..' - )); - const modulePath = path.normalize(path.join('test-non-core-module', 'lib', 'copy-sync.js')); + const baseDir = path.normalize( + path.resolve( + path.dirname(require.resolve('test-non-core-module')), + '..' + ) + ); + const modulePath = path.normalize( + path.join('test-non-core-module', 'lib', 'copy-sync.js') + ); it('should call `onRequire`', () => { const exports = require('test-non-core-module/lib/copy-sync'); assert.deepStrictEqual(exports.__ritmOnRequires, [ @@ -162,7 +173,12 @@ describe('RequireInTheMiddleSingleton', () => { ]); sinon.assert.calledWithMatch( onRequireCpxStub, - { __ritmOnRequires: ['test-non-core-module', 'test-non-core-module-lib'] }, + { + __ritmOnRequires: [ + 'test-non-core-module', + 'test-non-core-module-lib', + ], + }, modulePath, baseDir ); @@ -179,7 +195,6 @@ describe('RequireInTheMiddleSingleton', () => { baseDir ); }).timeout(30000); - }); }); });