Skip to content

Same test api #32

Description

@jimmywarting

I have played around with Deno's built in test runner before.
it's pretty nice. but i tend to not use it if i'm also writing test cases that should run in different env.

When i write test cases for both NodeJS and Deno then i tend to simply just use a simple array or an object myself to define all test cases and import all files that i want to test. Then i just use a simple logic function that are very similar to console.assert but it throws instead. then i simply just write a for loop to exec all functions, if the env match Deno then i use Deno.test otherwise it have just been a classic for loop that execute. very simple and fast but lose a lot of shiny features for the cost of being more cross compatible. I'm not such a huge fan of any of the existing test framework that exist out there on npm atm.

now i found out that NodeJS also have a test runner built in

it would be nice if both could play ball and work the same way...
I know this isn't something web related but it would be nice if i could write test cases the same way.
Would even wish for there to be some browserified version of it too.

Bonus point if there where something like node --test --browsers that could launch maybe a headless browser or where i could open up a own browser and navigate to url to hook it in.

  • then it would dump everything to the console,
  • talk with each other over websocket
  • hook it into file changes
  • have some good CI/CD that could execute all test cases in a browser and exit with either an error or a success in the terminal

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions