Skip to content

Commit

Permalink
Debug test node path
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Jan 20, 2023
1 parent 3acceed commit ebb389e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/lib/runtimeSettings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ebb389e

Please sign in to comment.