exercism / typescript

Exercism exercises in TypeScript.
https://exercism.org/tracks/typescript
MIT License
148 stars 160 forks source link

Add test-runner flags #1517

Closed SleeplessByte closed 2 months ago

SleeplessByte commented 2 months ago

These flags are implemented in the javascript repo, and when I checked I found out the support in the typescript test runner. Specifically they enable some output changes based on the settings and we can handle exercises differently.

For example, concept exercises should have task per describe set to true so that it executes:

// Version 3 optionally can output the task ID
if (this.configFlag('flag.tests.task-per-describe')) {
  return {
    ...test,
    task_id: testCase.topLevelIndex,
    test_code: testCase.testCode(parsedSource.source),
  }
}