-
Notifications
You must be signed in to change notification settings - Fork 354
Add mutual assignability tests for parsed types <-> data-schema types #2402
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
Conversation
Size Change: +57 B (+0.01%) Total Size: 466 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (c48f89b) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2402 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.js -t PR2402 |
844e18c
to
1aad140
Compare
…n catch more issues
…that the data format accepted by `parseAndMigratePerseusItem` stays in sync with the types in `data-schema.ts`, exported from `@khanacademy/perseus-core`.
1f59a66
to
e710c9c
Compare
@@ -53,7 +47,7 @@ function deprecatedSimplifyValuesToRequired( | |||
| null | |||
| undefined | |||
| boolean, | |||
): PerseusNumericInputSimplify { | |||
): "enforced" | "required" | "optional" { |
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.
Did you change this because the type tests will now verify the return value matches PerseusNumericInputSimplify
?
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.
Right!
These typetests ensure that our parsers stay in sync with the data-schema types.
but don't update the parser, you will get a type error.
you will get a type error.
While adding these typetests, I found some discrepancies in our existing types, which are
fixed in this PR.
Test plan:
pnpm tsc