haraka / test-fixtures

Fixtures for testing Haraka and plugins
https://www.npmjs.com/package/haraka-test-fixtures
MIT License
2 stars 7 forks source link

problem with paths #45

Open danieltigse opened 4 years ago

danieltigse commented 4 years ago

I am trying to use haraka-test-fixtures but I am having problems with the function sandbox_require of vm_harness. Basically it can't find my dependencies. To give you more context: I have a plugin and I do a require of another file in the same path of the plugin. When the test try to look for the file it can be found because you have declared only this paths:

const dir_paths = [
    __dirname + '/../../../',  // for Haraka/tests/plugins
    __dirname + '/',           // for haraka-test-fixtures/test
];

is there a way that the require search in the same path where my plugin is?

Ryan-Knepp commented 3 years ago

I just ran into this same issue too. Is there a reason why find_haraka_lib ignores the path when it can't find it in any of the dir_paths? I'm thinking having this just return id if it can't find anything would do the trick.

msimerson commented 3 years ago

As the author of haraka-test-fixtures, I can tell you that I addressed all the known paths, at the time I wrote it. If it needs to be extended, PRs are welcome.