async function testRun(args = [], hooks = {}) {
        const result = await run(args, hooks);
        const stdout = testing ? JSON.parse(result.stdout) : { script: null, env: {} };

        return {
            ...result,

            /**
             * @param {import("ava").Assertions} t
             * @param {string} script
             **/
            assertScript(t, script) {
                t.is(stdout.script, script);
            },

            /**
             * @param {import("ava").Assertions} t
             * @param {Record<string, string>} env
             **/
            assertEnv(t, env) {
                t.deepEqual(stdout.env, env);
            }
        };
    }
Run the Mix and build in assertions

@param {string[]} args
@param {CliHooks} [hooks]