From 4ad1f6d47b2f7c04a4ce83c3560b10cd7ffcb489 Mon Sep 17 00:00:00 2001 From: da-levkovets Date: Mon, 20 Nov 2023 17:29:23 +0300 Subject: [PATCH] Parse plugin-name from .pnpm/.pnpm-store --- src/parse-plugin-name.spec.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/parse-plugin-name.spec.ts b/src/parse-plugin-name.spec.ts index 4ab1043..f31049a 100644 --- a/src/parse-plugin-name.spec.ts +++ b/src/parse-plugin-name.spec.ts @@ -106,9 +106,9 @@ describe('parsePluginName', () => { test('should return a plugin name from a stack if it is in .pnpm', () => { const stack = ` - at Hermione.herm. (/Users/da-levkovets/arcadia/search-interfaces/oceania/projects/web4/node_modules/.pnpm/hermione-plugins-profiler@0.2.3/node_modules/hermione-plugins-profiler/build/wrap-hermione-handler.js:13:19) - at module.exports (/Users/da-levkovets/arcadia/search-interfaces/oceania/projects/web4/node_modules/.pnpm/hermione-passive-browsers@0.3.2/node_modules/hermione-passive-browsers/lib/index.js:54:14) - at /Users/da-levkovets/arcadia/search-interfaces/oceania/projects/web4/node_modules/.pnpm/plugins-loader@1.2.0/node_modules/plugins-loader/lib/loader.js:19:80 + at Hermione.herm. (/Users/name/prj/node_modules/.pnpm/hermione-plugins-profiler@0.0.0/node_modules/hermione-plugins-profiler/index.js:48:20) + at module.exports (/Users/name/prj/node_modules/.pnpm/some-plugin@1.0.0/node_modules/some-plugin/index.js:48:20) + at /Users/name/prj/node_modules/.pnpm/plugins-loader/node_modules/plugins-loader/index.js:48:20 at Module.load (node:internal/modules/cjs/loader:1037:32) `; @@ -116,21 +116,21 @@ describe('parsePluginName', () => { err.stack = stack; - expect(parsePluginName(err)).toEqual('hermione-passive-browsers'); + expect(parsePluginName(err)).toEqual('some-plugin'); }); test('should return a plugin name from a stack if it is in .pnpm-store', () => { const stack = ` - at Hermione.herm. [as on] (/Users/da-levkovets/.pnpm-store/oceania-virtual-store/hermione-plugins-profiler@0.2.3/node_modules/hermione-plugins-profiler/build/wrap-hermione-handler.js:14:29) - at module.exports (/Users/da-levkovets/.pnpm-store/oceania-virtual-store/@yandex-int+html-reporter-dumps-plugin@0.5.7_56d91d656e193c0ca144cec591e28121/node_modules/@yandex-int/html-reporter-dumps-plugin/src/hermione/index.ts:22:14) - at /Users/da-levkovets/.pnpm-store/oceania-virtual-store/plugins-loader@1.2.0/node_modules/plugins-loader/lib/loader.js:19:80 - at /Users/da-levkovets/.pnpm-store/oceania-virtual-store/plugins-loader@1.2.0/node_modules/plugins-loader/lib/index.js:9:26 + at Hermione.herm. [as on] (/Users/name/.pnpm-store/some-virtual-store/hermione-plugins-profiler@0.0.0/node_modules/hermione-plugins-profiler/index.js:48:20) + at module.exports (/Users/name/.pnpm-store/some-virtual-store/@some-plugin@0.0.0_56d91d656e193c0ca144cec591e28121/node_modules/@yandex-int/some-plugin/index.js:48:20) + at /Users/name/.pnpm-store/some-virtual-store/plugins-loader@0.0.0/node_modules/plugins-loader/lib/index.js:48:20 + at /Users/name/.pnpm-store/some-virtual-store/plugins-loader@0.0.0/node_modules/plugins-loader/lib/index.js:48:20 `; const err = new Error(); err.stack = stack; - expect(parsePluginName(err)).toEqual('@yandex-int/html-reporter-dumps-plugin'); + expect(parsePluginName(err)).toEqual('@yandex-int/some-plugin'); }); });