From ebb389e365827c96f75a5839549c42ee04db2a91 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 20 Jan 2023 16:54:15 +0000 Subject: [PATCH] Debug test node path --- test/unit/lib/runtimeSettings_spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/lib/runtimeSettings_spec.js b/test/unit/lib/runtimeSettings_spec.js index ca9c6b0..00d08e8 100644 --- a/test/unit/lib/runtimeSettings_spec.js +++ b/test/unit/lib/runtimeSettings_spec.js @@ -16,11 +16,16 @@ describe('Runtime Settings', function () { async function loadSettings (content) { // Need to fix the node path inside the content to ensure it can find // the @flowforge/nr- modules it tries to load + // const selfPath = path.normalize(path.join(__dirname, '../../../../node_modules')).split(path.sep).join('/') // nmPath - when nr-auth is installed in our local node_modules const nmPath = path.normalize(path.join(__dirname, '../../../node_modules')).split(path.sep).join('/') // nmPath2 - when running inside flowforge-dev-env, need to go higher in the tree const nmPath2 = path.normalize(path.join(__dirname, '../../../../../node_modules')).split(path.sep).join('/') + // content = `module.paths.unshift('${selfPath}', '${nmPath}', '${nmPath2}'); ${content}` content = `module.paths.unshift('${nmPath}', '${nmPath2}'); ${content}` + console.log(__dirname) + console.log(nmPath) + console.log(nmPath2) const fn = path.normalize(path.join(TMPDIR, `${Math.random().toString(36).substring(2)}.js`)).split(path.sep).join('/') await fs.writeFile(fn, content) return require(fn)