Closed bikerp closed 5 years ago
Depending on your environment, you could try using :
path.join(process.cwd(), './src/whenever/you/might/need')
I tried but the result is the same. I still get the error message ' No structure loaded for ...!'
In order to be able to provide more detailed help I would need a test repro which demonstrates the problem.
Hints:
item
?I have forked the cqrs-sample project and set up the tests. The repo is here https://github.com/bikerp/cqrs-sample
I think I found the issue. If the folder src/domain
contains node_modules
then the test fails with the mentioned error.
If I delete the node_modules
folder the the test succeed
@nanov Any idea what could cause the issue?
You did answer yourself, I guess you would have to introduce another folder layer in order for this to work.
Ok, so when I require 'cqrs-domain' package directly from the tested folder and it works. Thanks
Hi, I'm trying to write unit tests for commands. My directory structure is following:
The issue is that referencing the item folder from tests folder doesn't work if in test.js i have:
const domain = require('cqrs-domain')({ domainPath: path.join(__dirname, '../src/domain/lib') });
I have checked the examples in integrationTests but I don't think I'm doing anything wrong. Thanks for any help