Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Research Typescript as an alternative for testing #47

Closed
NonlinearFruit opened this issue Mar 3, 2023 · 6 comments
Closed

Research Typescript as an alternative for testing #47

NonlinearFruit opened this issue Mar 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@NonlinearFruit
Copy link
Owner

(Idea came from #46)

Can we cleanly use Typescript just for testing?

@NonlinearFruit NonlinearFruit added the enhancement New feature or request label Mar 3, 2023
@NonlinearFruit
Copy link
Owner Author

Typescript doesn't do runtime checking so it can't check if json matches a type.

@NonlinearFruit
Copy link
Owner Author

Use describe.each() for parameterized test groups (source) or test.each. it is an alias for test

@NonlinearFruit
Copy link
Owner Author

The goal is to have more specific error messages when something is broken. Right now with our tests, it will say 'Something didn't meet this requirement' but doesn't always say which creed and where in the creed it failed.

If typescript vitests can do this, we should convert. There are other benefits but this is the primary one

@NonlinearFruit
Copy link
Owner Author

We have:

  • parameterized tests (for the creeds in the creeds/ folder)
  • schema verification (for metadata and creed specific schemas)
  • ascii only verification

The footnote-y bits are left:

  • has a footnote for each proof text
  • has a proof text for each footnote
  • has no footnotes in non-'WithProofs' strings

Maybe also test:

  • footnote ids are consecutive (starting at 1)

@NonlinearFruit
Copy link
Owner Author

NonlinearFruit commented Mar 17, 2023

It works!! All 'em tests be re-written and it is pretty nice.

Here are some stretch goals:

  • proof text ids are consecutive (starting at 1)
  • json scheme generated from typescript type
  • Isolate the typescript-y bits to the test directory
  • break some of the larger tests into parameterized tests with descriptive names

@NonlinearFruit
Copy link
Owner Author

We're going to TypeScript!

#48

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant