Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compat: libraries can't spawn Deno subprocess properly #13322

Closed
bartlomieju opened this issue Jan 9, 2022 · 0 comments · Fixed by #15678
Closed

compat: libraries can't spawn Deno subprocess properly #13322

bartlomieju opened this issue Jan 9, 2022 · 0 comments · Fixed by #15678
Labels
bug Something isn't working correctly node compat

Comments

@bartlomieju
Copy link
Member

Hit this problem when trying to get tap to work in "--compat" mode.

This snippet shows how tap runs a single file with tests:

        debug('js file', file)
        /* istanbul ignore next - version specific behavior */
        const experimental = /^v10\./.test(process.version) && /\.mjs$/.test(file)
          ? ['--experimental-modules'] : []

        const args = [
          ...options['node-arg'],
          ...experimental,
          file,
          ...options['test-arg']
        ]
        tap.spawn(node, args, opt, file)

node is defined as:

const node = process.execPath

Later it constructs a command to be run using something like this:

const cp = require("child_process");
const p = {
  spawn: async (name, ...rest) => cp.spawn(...rest);
};
await p.spawn(this.name, this.command, this.args, options);

tap is not aware that it must run the process by using deno run --compat --unstable args and only uses deno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant