Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4247

Add type checking to mocha tests

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Testing
    • Labels:

      Use Case

      As a node engineer
      I want the tests directory to be type checked in CI
      So that we can rely on typescript issues across all our own usages of our API

      User (driver engineer) Impact

      • Type checking tests helps read them, and call out intentional misuse of APIs (for failure tests)
      • Auto completion of our own APIs helps with onboarding
      • Increases coverage of our types, if tests have to use the API correctly changes to types will alert us if we use that API in a test

      Dependencies

      • Typescript

      Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • Move the current tsconfig.json to tsconfig.src.json
      • Add a new tsconfig.json that includes the test directory
        • Add the noEmit flag to the compilerOptions
        • Add the allowJs to check files that haven't been converted to TS
      • Update our prepare and build scripts to build with the "production" tsconfig.src.json
        • make sure npm "files" ships the production config
      • Correct type errors or reduce strictness as needed, file follow ups to address issues

      Testing Requirements

      • Add a new lint task that runs type checking on the tests files
      • Add a separate lint task that ensures tsconfig.src.json continues to build the driver source correctly

      Documentation Requirements

      • None

      Follow Up Requirements

      • Type issue fixes, further test to ts conversions

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: