stryker-mutator / stryker-js

Mutation testing for JavaScript and friends
https://stryker-mutator.io
Apache License 2.0
2.58k stars 246 forks source link

Has anyone ever tried running Stryker with Deno? #2977

Open gtramontina opened 3 years ago

gtramontina commented 3 years ago

Question

Has anyone ever tried running Stryker with Deno?

Stryker environment

n/a

Additional context

Wondering if anyone has ever ran Stryker with Deno and its built-in test engine and, if so, what were the hurdles they had to go through? Eventually adding some info to the project website could be helpful to others.

nicojs commented 3 years ago

Hi @gtramontina 🙋‍♂️

I was wondering when the first issue regarding Deno would pop up 😅

I've not had the time to look into the details, but as far as I know, StrykerJS can not run on Deno at the moment and will take quite some work to make it compatible.

Some remarks that popup in my head:

CommonJS

StrykerJS is currently compiled as CommonJS modules, which is not supported in Deno (right? or did something change here?). Stryker is build with 100% TypeScript, so compiling to es modules is trivial. However, we also use __dirname, require, require.resolve, etc which will have to be refactored to use import and import.meta.

Imports with bare import specifiers

If StrykerJS was 100% ESM, we're still dependent on quite a big list of dependencies, which should all be compatible with deno (AFAIK). For example: in order to mutate JS files, Stryker will import from babel:

import { parseAsync } from '@babel/core';

How would this work in deno 🤷‍♂️?

Import from core modules

We might depend on nodejs core modules that are not supported in deno, see: https://deno.land/std@0.100.0/node/README.md

Deno test runner

This is a smaller thing, but we would need to create a deno test runner that is compatible with deno's build in test runner.

Note: this is optional, as the command test runner should work:

{
  "testRunner": "command",
  "commandRunner": { 
    "command": "deno test" 
  }
}
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

nicojs commented 2 years ago

Thanks @stalebot, but we're keeping this one open