aclap-dev / vdhcoapp

Companion application for Video DownloadHelper browser add-on
GNU General Public License v2.0
1.72k stars 280 forks source link

added challenge support #157

Closed mi-g closed 1 year ago

paulrouget commented 1 year ago

Maybe add a way to distinguish between a null result and an exception result.

paulrouget commented 1 year ago

And any reason to not send ((a) => {${code}})('${challenge}') as a parameter, and make this function more generic?

paulrouget commented 1 year ago

Also, add a test here: https://github.com/aclap-dev/vdhcoapp/blob/coapp-1.7.0/tests/test.mjs

Something as simple as:

let x = await exec("challenge", "return a + 1", 42);
assert("challenge", x, 43);

You can run the test simply with:

./test/test.mjs

Make sure to have node 18 as your node version.