[X] This is the appropriate issue form for the bug I would like to report.
Expected
I forked this test file projects/arrays/text-processor/src/index.test.ts to a new file named projects/arrays/text-processor/src/index-alternate.test.ts
and changes a little in order to test projects/arrays/text-processor/src/solution-alternate.ts.
Bug Report Checklist
main
branch of the repository.Expected
I forked this test file
projects/arrays/text-processor/src/index.test.ts
to a new file namedprojects/arrays/text-processor/src/index-alternate.test.ts
and changes a little in order to testprojects/arrays/text-processor/src/solution-alternate.ts
.Here is the content of
index-alternate.test.ts
:As usual, I expect all tests will be passed.
Actual
But I got many tests failed.
Here is the key part of the test output:
Impacted Project
Additional Info
So I read through this file
solution-alternate.ts
and found some issues.#1
typo: padEnd should be padStart#2
use explicit callback and call aligner function with correct paramters.#3
use string.repeat() helper method because the result of Array.from() is weird on some test cases. See the example below for more details.Reproduce Array.from() bug
final
After the fix above, all tests have passed in my local enviroment.