thefrontside / simulacrum

A simulation platform for use during testing, during development and for high-fidelity application previews
88 stars 14 forks source link

Create better typing around simulator options #209

Open dagda1 opened 2 years ago

dagda1 commented 2 years ago

Currently, it is too easy to pass the wrong config in when creating a simulation because of this interface

export interface SimulationOptions {
  options?: Record<string, unknown>;

The code below will type check even though clientId is cased incorrectly

     createSimulation(simulator: "auth0",
      options: {
        options:{
          clientId: "[your client-id]"

This codesandbox was a quick spike for one way this could be significantly improved.