Change testing structure. #1598
jimmywarting
started this conversation in
General
Replies: 1 comment
-
If you dont pick a framework you end up creating your own. I dont feel this is the right project to start brewing our own cross platform testing framework. There must be something out there already. Mocha should have what we are looking for. It supports both node, browser and deno via ESM. Check https://dev.to/craigmorten/testing-your-deno-apps-with-mocha-4f35 for inspiration. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When i have been writing test for cross env. then i have mostly opt'ed out of using barely any testing frameworks or depend on any built in features. (such as node:assert, mocka, global
describe
orit
or anything really)I just mostly create my own assertion functions that i need and most of the time it's just a simple function that checks if first param is truthy and if it isn't then it throw an error with the 2nd string parameter... And use that basically for everything.
Then i write my own test objects and push them into some storage.
it basically goes like:
Then depending on if i'm running things in Deno, or NodeJS then i use their own built in test runner.
and basically do something in lines of:
So you could say that my way of writing test cases are more or less Isomorphic and can be executed with any test-runner i wish to use. weather it's NodeJS or Deno's built in test runner or mocha in browsers.
What do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions