Comments (7)
Some more detail, if I test.skip
on the 'I try to create a user with invalid data'
test, I can make the test fail every time. This suggests that the tests fail intermittently when the 'I can create a user'
runs first. And when I run the create-user.e2e-spec.ts
in isolation, the test passes.
This leads me to believe there is some residual state from the delete-user.e2e-spec.ts
test that causes this failure.
from domain-driven-hexagon.
I just tried it and tests worked fine for me. Here are the steps that I used:
npm run docker:env
- run dockercreate database ddh_tests
- execute this SQL query to create a database for testsnpm run migration:up:tests
- execute migrations for test dbnpm run test:e2e
- run tests
from domain-driven-hexagon.
That more or less matches what I did you setup the test suite.
It very much seems to matter what the test execution order is. The order that seems to reliably reproduced the issue, is:
delete-user.e2e-spec.ts
create-user.e2e-spec.ts
- specifically with theI can create a user
test running first. skipping the other test makes this easier to reproduce, because then it's just a matter of jest executing thedelete-user
test suite before thecreate-user
test suite.
I've also added logging in the tests in order to query the entire contents of the user table in the db right before the I can create a user
runs, and it shows the table as empty. This is more concerning, as now I suspect there is something wrong with the server-side code to unexpectedly encounter a user conflict on the john doe email address. I'll keep digging and report my findings back here.
from domain-driven-hexagon.
@zacharyweidenbach you are executing yarn test
, you have to execute yarn test:e2e
from domain-driven-hexagon.
That seems to have resolved the failures. Even if I use jest's test-sequencer to coerce jest into running the delete-user test first, they both pass. Although that raises the question what's different between the .jestrc.json
file and the jest-e2e.json
that could explain why it was failing for yarn test
and not yarn test:e2e
. The only difference between them seems to be the coverageDirectory
and the testRegex
. I would expect to see different global setup files or something to understand what was missing from the yarn test
config.
from domain-driven-hexagon.
Disregard, I see the test:e2e
script uses -i
which is the jest option --runInBand
in order to serialize the tests on the current process.
from domain-driven-hexagon.
Closing, using the wrong test script
from domain-driven-hexagon.
Related Issues (20)
- `StructuredClone()` function converts entity object into plain object, causing `undefined` properties when calling getters HOT 2
- @slonik/migrator is not compatible with slonik 30+ HOT 9
- InternalServerErrorException has incorrect documentation HOT 1
- FindUsersQuery should map data to response in order to avoid leaks HOT 1
- Why are ports defined in infrastructure layer? HOT 2
- Clarification on the Practical Usage of Domain Services in DDD
- typeof id is undefined HOT 4
- execute start:dev throws error HOT 6
- Implement and add examples for Adapters and Providers from Infrastructure folder? HOT 6
- Enable GitHub discussions ? HOT 1
- Correct approach for different types of concept? HOT 1
- UnitOfWork creating many QueryRunners and not release them HOT 4
- Types are incorrect for value object's unpack method
- Dependency Inversion in new version HOT 1
- Queries using repositories HOT 1
- Query handler breaking the dependency rule? HOT 4
- Authentication module HOT 1
- Resolver returning type HOT 1
- resolver return HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domain-driven-hexagon.