wenyan-lang/wenyan

Use Jest to automatically test the program

calpa opened this issue · 4 comments

calpa commented

Instead of checking the error by human, we can use Jest to test automatically.

For example:

吾有一數。曰三。名之曰「甲」。

This sentence should init a variable call ,and it is 3

Great idea, now that pull requests and new examples proposed all the time, automated testing would be very helpful.
I'm not very familiar with Jest, if you could help out and make a pull request I'd really appreciate it. Otherwise I can look into Jest and and see what I can do.
Thanks!

timeswind kindly submitted some tests using Mocha: https://github.com/LingDong-/wenyan-lang/pull/61

As I don't have a preference, perhaps let's go with Mocha, unless someone can think of some fundamental superiority for Jest ;)

何不試以文言測之?

antfu commented

Closing now. Since we are already using Mocha for testing. If you got any questions, feel free to reopen it.