diff --git a/packages/react/package.json b/packages/react/package.json index 48b35583..ed0287b7 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -53,7 +53,7 @@ "ava": "latest", "babel-plugin-transform-react-pure-class-to-function": "latest", "babel-plugin-transform-react-remove-prop-types": "latest", - "execa": "latest", + "tinyspawn": "latest", "lodash": "latest", "prop-types": "latest", "react": "18", diff --git a/packages/react/test/build.mjs b/packages/react/test/build.mjs index f6b4dcb2..4c6a0225 100644 --- a/packages/react/test/build.mjs +++ b/packages/react/test/build.mjs @@ -1,8 +1,8 @@ -import { $ } from 'execa' +import $ from 'tinyspawn' import test from 'ava' -const evalScript = code => $`node --eval ${code}`.then(({ stdout }) => stdout) -evalScript.esm = code => $`node --input-type module --eval ${code}`.then(({ stdout }) => stdout) +const evalScript = (code, flags = []) => $('node', ['--eval', code, ...flags]).then(({ stdout }) => stdout) +evalScript.esm = code => evalScript(code, ['--input-type', 'module']) test('cjs', async t => { t.snapshot((await evalScript("console.log(require('./dist/microlink.cjs'))")))