Skip to content
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

Conversation

wdpm
Copy link
Contributor

@wdpm wdpm commented Aug 10, 2023

PR Checklist

Overview

solution-alternate.ts has no test before, now it has. And fix some logical errors of solution-alternate.ts.

line,
Array.from({ length: Math.ceil(remainingSpaces / 2) }, () => " "),
].join(" ")
" ".repeat(Math.ceil(remainingSpaces / 2)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a 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;
Copy link
Contributor

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.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 8e91b6b into LearningTypeScript:main Aug 12, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug: projects/arrays/text-processor/src/solution-alternate.ts has some bugs
2 participants