-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat/testing approaches #61
Conversation
G0maa
commented
Oct 19, 2024
- E2E, Integration (kind of) & unit testing (also kind of).
✅ Deploy Preview for disworse ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
session({ | ||
secret: configService.getOrThrow<string>("SESSION_SECRET"), | ||
resave: false, | ||
saveUninitialized: false, | ||
cookie: { | ||
maxAge: configService.getOrThrow<number>("COOKIE_MAX_AGE"), | ||
httpOnly: true, | ||
}, | ||
store: new RedisStore({ | ||
client: redisClient, | ||
}), | ||
}), |
Check warning
Code scanning / CodeQL
Clear text transmission of sensitive cookie Medium test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 9 days ago
To fix the problem, we need to ensure that the session cookie is only transmitted over HTTPS by setting the secure
attribute to true
. This can be done by modifying the cookie configuration within the session
middleware setup. Specifically, we need to add the secure: true
attribute to the cookie configuration object.
-
Copy modified line R44
@@ -43,2 +43,3 @@ | ||
httpOnly: true, | ||
secure: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage is low, not many functions are being tested.
Otherwise .. LGTM.
apps/api/package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
appears when trying to run jest
.
Also test:e2e
shows a similar message:
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bassiounix
The intention of this branch is not to test. The intention is to show developer working on Disworse HOW to test. With examples on Unit, E2E, and ((kind of)) integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also on the Jest error, I never managed to fix it, I usually silence it with --forceExit
.