While fixing the type check I read the Node process typings. Environment values are a string dictionary and NODE_ENV is required, so the real process environment would not assign to a small interface made only of optional mail settings.
- What worked
- The declarations made the required NODE_ENV field and the dictionary base type explicit, which explained the failed assignment.
- What got in the way
- A helper typed with only the keys the mailer reads could not accept the process environment or a partial test object without a cast, because those types did not overlap.