Fork me on GitHub

Surprised that these console.log different things?


I am! 🙂


I'm not but that can be fixed :) - issue welcome

👍 1

Did anyone explore Cypress + nbb yet? Can that work at all?


I did a trial, forgot about it, found it now and too ashamed to put it out in the open 😄


There are examples for puppeteer and playwright. I believe (I cannot claim) that testing is one of the cases @U04V15CAJ would like to have covered. @U06QSF3BK you should not be ashamed! can you share anything? at least in gist or something?


testing with cljs.test is covered in the docs. Node.js projects that behave like frameworks should probably be used with a JS wrapper


Buuut, it went like this • nbb is meant to run ontop of node, but the JavaScript that Cypress test is, is run in the browser • So we kinda want sci in the browser • but hey! nbb.loadString() let's try that! • um... how do I carry a string for nbb to load into the browser • wait, I think one can require("file.json") and webpack then bundles the json into the javascript bundle • neat! let's try writing a cypress preprocessor that when seeing a .cljs file, grabs the source, writes it into a source.json file, then spits out a javascript file that does uses nbb to load the code, something like

fs.writeFileSync(stubPath, `const code = require('${codePath}'); console.log(code.code); import {loadString} from \"nbb\"; loadString(code.code)`);
• then I look at that I did and go hmm....


now I go off to have dinner :D


cypress runs in the browser? for browser testing I'd go with playwright + cljs.test then


hmm, from what I understand they have a Dashboard which instruments tests written as .js "modules". So maybe go with js wrapper makes sense. Although it's a bit awkward 😞


ff-ing frameworks


"let's make things easy" :P


random google, but I guess the initial idea was to try do a bit different


the test script is run inside the browser, in an iframe IIRC, somehow it talks to the driver that is a node program, I guess the initial idea was to have a more direct access to stuff inside the browser, but yeah, this kinda puts the "test" in a bit awkward position, since you can only run javascript, which puts you into the "let's make everything as javascript" bundle mangle


contrasting this to stuff that talks to a browser and to a test that executes outside the browser, I guess those things used to be a bit crippled back in the day


now things might have turned into different direction


oh the technology


If I remember correctly, in our company, we had cypress, but later we moved to puppeteer, because it was giving us better results. I think playwright would be our choice these days - because supporting multiple browsers.


I didn’t realize Playwright can deal with multiple browsers, that’s a real game changer for us as Cypress has been pretty limiting in that regard


etaoin (webdriver) is now also compatible with babashka: so you could also try that approach


hey, is there anything in clojurescript/SCI that wraps process initialization through nodejs? like this js lib: asking here as it's an intersection of clojurescipt and node, also asked on the main channel


@zimablue Why not use that library ? nbb is designed so you can easily use npm libs


yeah I was about to use it and thought I should check if something in clj-x exists as it will be easier to debug /read without context switching


if none immediately comes to your mind there probably isn't one


Just checking (idk the usefulness) - has anyone written an "express-ring-adapter" or similar?


@emccue There is this: I don't think it runs out of the box with nbb, but we could try to make that work.