How to use domainPath in unit tests
See original GitHub issueHi, I’m trying to write unit tests for commands. My directory structure is following:
`|-- src
| |-- domain
| `-- lib
| `-- item
| |-- aggregate.js
| |-- command.js
| `-- event.js
`-- tests
`-- test.js
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
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
c# - How to get Directory while running unit test - Stack Overflow
You can do it like this: using System.IO; Path.GetFullPath(Path.
Read more >Domain and Paths | Computer Science Engineering | DBS Talks
Domain and Paths ! The Domain Path module allows the creation of separate path aliases per domain for nodes created using the Domain...
Read more >Unit test reports - GitLab Documentation
Use name and path to find and rerun the test locally for verification. To copy the name of all failed tests, at the...
Read more >Unit Testing - Viash
This tutorial uses a sample component named md_url_checker to explain how to write a unit test for Viash. To follow along, start by...
Read more >Build unit tests | Firebase Security Rules - Google
Use the Firebase Emulators to run and automate unit tests in a local environment. ... https://<database_name>.firebaseio.com/path/to/my/data.json.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, so when I require ‘cqrs-domain’ package directly from the tested folder and it works. Thanks
You did answer yourself, I guess you would have to introduce another folder layer in order for this to work.