From d8b2b2cd96891b211ff8960dcf9c2bef90772364 Mon Sep 17 00:00:00 2001 From: Annosha Date: Fri, 18 Oct 2024 13:56:17 +0500 Subject: [PATCH] add type declaration for test-none-core-module --- .../test/node/RequireInTheMiddleSingleton.test.ts | 1 + .../test/node/node_modules/test-non-core-module/index.js | 5 ++--- .../node_modules/test-non-core-module/lib/copy-sync.d.ts | 2 ++ .../node/node_modules/test-non-core-module/lib/copy-sync.js | 6 ++---- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.d.ts diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts b/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts index 1f8b45ef01c..53d756712fa 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts +++ b/experimental/packages/opentelemetry-instrumentation/test/node/RequireInTheMiddleSingleton.test.ts @@ -179,6 +179,7 @@ describe('RequireInTheMiddleSingleton', () => { baseDir ); }).timeout(30000); + }); }); }); diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/index.js b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/index.js index 8fc30cc603a..00ae95c4a1c 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/index.js +++ b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/index.js @@ -1,4 +1,3 @@ module.exports = { - copy: require('./copy-sync') - }; - \ No newline at end of file + copy: require('./lib/copy-sync') // matches the original API +}; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.d.ts b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.d.ts new file mode 100644 index 00000000000..76ea67629a1 --- /dev/null +++ b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.d.ts @@ -0,0 +1,2 @@ +declare function copySync(): void; +export = copySync; diff --git a/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.js b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.js index a64ae2e0d46..97da7acc8cd 100644 --- a/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.js +++ b/experimental/packages/opentelemetry-instrumentation/test/node/node_modules/test-non-core-module/lib/copy-sync.js @@ -1,5 +1,3 @@ module.exports = function copySync() { - // No-op function simulating cpx2 behavior for tests - console.log('Mock copySync called'); - }; - \ No newline at end of file + console.log('Mock copySync called'); +};