LearningTypeScript / projects

Hands-on real world projects that will help you exercise your knowledge of TypeScript.
https://learningtypescript.com/projects
240 stars 161 forks source link

fix: corrected test case types for text-processor #161

Closed JoshuaKGoldberg closed 2 years ago

JoshuaKGoldberg commented 2 years ago

PR Checklist

Overview

The solution causes a tsc complaint for strings not matching the union of literals "left" | "middle" | "right".

Argument of type '{ width: number; } | { align: string; width: number; }' is not assignable to parameter of type 'AlignmentOptions'.
  Type '{ align: string; width: number; }' is not assignable to type 'AlignmentOptions'.
    Types of property 'align' are incompatible.
      Type 'string' is not assignable to type '"left" | "middle" | "right" | undefined'.