-
Notifications
You must be signed in to change notification settings - Fork 977
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
test: fix compile errors in commands.ts
#3179
Conversation
d1e02db
to
eb0a265
Compare
@@ -16,6 +16,7 @@ | |||
"cypress": "^11.2.0", | |||
"dayjs": "^1.10.4", | |||
"got": "^11.8.2", | |||
"json-schema-to-typescript": "^12.0.0", |
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.
This tool is pretty cool! We now have a generated d.ts
file of our config, that we can use in the tests to get typesafe config updates. Always bugged me, that I wasn't able to get code completion when working with it.
https://github.com/bcherny/json-schema-to-typescript#readme
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.
cool idea
commands.ts
commands.ts
commands.ts
@@ -147,7 +147,9 @@ context("Registration success with email profile with webhooks", () => { | |||
expect(identity.schema_id).to.equal("default") | |||
expect(identity.schema_url).to.equal(`${APP_URL}/schemas/ZGVmYXVsdA`) | |||
expect(identity.traits.email).to.equal("updated-" + email) | |||
expect(identity.metadata_public.some).to.equal("public fields") | |||
expect((identity as any).metadata_public.some).to.equal( |
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.
These types still use a pretty old version of @ory/kratos-client
, where metadata_public
didn't exist, yet. But I want to do that in a future PR.
export type OryKratosConfiguration = OryKratosConfiguration1 & | ||
OryKratosConfiguration2 | ||
export type OryKratosConfiguration1 = { | ||
[k: string]: unknown | undefined | ||
} |
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.
Not sure, why it generates these 1, 2 versions, but I traced it to being related to the allOf
block at the end of the config. Not sure if there is anything we can do about that here.
Codecov Report
@@ Coverage Diff @@
## master #3179 +/- ##
==========================================
- Coverage 77.73% 77.62% -0.11%
==========================================
Files 317 317
Lines 20046 20046
==========================================
- Hits 15583 15561 -22
- Misses 3275 3292 +17
- Partials 1188 1193 +5 see 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Fixes a few compile time issues in the cypress commands and adds generation of a type declaration for the Kratos configuration to be used within E2E tests.
Related issue(s)
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments