denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.01k stars 5.39k forks source link

Add support to test remote scripts, similar to "deno run https://examples.deno.land/hello-world.ts", but "deno test". #26967

Open lcrespilho opened 1 day ago

lcrespilho commented 1 day ago

It should be really nice to run remote tests, like: deno test -A https://example.com/my_test.ts

Could this be added to Deno?

Tanks.

bartlomieju commented 23 hours ago

Could you tell more about your use case? What's the benefit of running tests from a remote server?

lcrespilho commented 36 minutes ago

Sure, @bartlomieju .

Part of my company's job is to create end-to-end tests to validate implementations on sites that we specify, but our clients' developers implement. Currently, we run these tests in NodeJS/playwright every time a client notifies us that their technical team has finished an implementation sprint. So we can give feedback if it's OK according with the specification.

Teaching our clients how to install NodeJS, clone Git repositories and run the test is out of the question. Usually clients get stuck with NodeJS installation issues.

Since Deno is more straightforward and has less friction compared with NodeJS, I think that clients would make fewer mistakes, and in the end it would be just a matter of doing the following: curl -fsSL https://deno.land/install.sh | sh deno test -A --filter feature-123 "https://some.re.po/t123123123_test.ts"

It would have much less friction than the NodeJS version. It would help to gain more adoption and use cases for average programmers like me.

Regards.