We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2fc8d13 commit 3df6e16Copy full SHA for 3df6e16
lib/vm_harness.js
@@ -5,13 +5,19 @@ const vm = require('vm')
5
const dir_paths = [
6
`${__dirname}/../../../`, // for Haraka/tests/plugins
7
`${__dirname}/`, // for haraka-test-fixtures/test
8
+ `${__dirname}/../../../../../`, // for files in Haraka/
9
]
10
11
function dot_files(element) {
12
return element.match(/^\./) == null
13
}
14
15
function find_haraka_lib(id) {
16
+ // For local files in the project root directory
17
+ // e.g. "require('./example.js')"
18
+ if (id.includes('./') && id.includes('.js')) {
19
+ id = id.substring(2, (id.length - 3))
20
+ }
21
for (let i = 0; i < dir_paths.length; i++) {
22
const dirPath = `${dir_paths[i]}${id}.js`
23
// console.log('dirPath: ' + dirPath);
0 commit comments