-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
fix: add a test for solution-alternate.ts and fix its bugs #272
fix: add a test for solution-alternate.ts and fix its bugs #272
Conversation
line, | ||
Array.from({ length: Math.ceil(remainingSpaces / 2) }, () => " "), | ||
].join(" ") | ||
" ".repeat(Math.ceil(remainingSpaces / 2)), |
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.
I like this!
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 is wonderful, thanks @wdpm! Adding a specific test for the alternate solution is a nice touch.
import * as index from "./index"; | ||
import * as alternate from "./solution-alternate"; | ||
|
||
const { alignTexts } = process.env.TEST_SOLUTIONS ? alternate : index; |
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.
CI scripts were renaming solution_alternate
to index_alternate
, so I just renamed it to alternate
.
PR Checklist
Overview
solution-alternate.ts
has no test before, now it has. And fix some logical errors ofsolution-alternate.ts
.