-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#39 add basic behaviour tests #43
Conversation
Took forever to get Cucumber working with typescript and our project structure but finally found some good guides and explanations on how to configure cucumber properly. I installed https://github.com/timjroberts/cucumber-js-tsflow for the typescript integration, i hope that is fine |
2101356
to
c7a203f
Compare
I was finally able to add a first version of a test When i run Error: Cannot find module '@app/shared/commands/fleet-management/add-car-to-fleet' I guess the AddCarToFleetSteps.ts is not properly loaded. Probably a small typescript configuration which is not as clear to me currently :D Also this first attempt would only check if the command handler yields the correct event. Better approach would be to test a little bit more from the outside and check if the command will trigger and store an event in the "database". |
@bofalke I think the error is related to the fact that the namespace is not known within your script. Unfortunately, we have to use the helper package Here you find the command the starts the backend server using ts-node: https://github.com/proophboard/cody-engine/blob/main/packages/be/nodemon.json#L5 As you can see, the helper is passed to ts-node so that the namespaces get registered. You have to do the same when executing cucumber. |
You should set the env variable Set event store and document store adapter to "memory", so that the default case is triggered and you get back an in-memory event store and document store from the factory functions: Cody Engine will use them during test run and you can check streams and documents afterwards for events and state. |
c7a203f
to
91dafc3
Compare
To be honest i was not able to figure this out... I added a "scripts": {
"cucumber": "npx ts-node -r tsconfig-paths/register src/main.ts cucumber-js -p default"
} I get the error:
|
@bofalke That's not the same error as you got before, right? So I think the original error got solved :D |
1e2fde6
to
6da17da
Compare
6da17da
to
4431130
Compare
b4b103d
to
9afd540
Compare
Ref #39