AssetMapper, how to setup test environment without a build system #54429
Unanswered
norberttech
asked this question in
Q&A
Replies: 2 comments
-
|
The answer is that you actually need node to run your test if you need to use those kind of test frameworks. Node gonna be only required on dev and test env but not on production so we consider that as fine |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
any news here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I was recently looking into the nobuild approach promoted by AssetMapper and importmaps, and I love it 😍
However I got a bit stuck and the internet does not seems to be very helpful, but let me describe briefly what I'm trying to achieve.
So I'm building a relatively simple UI, mostly based on Stimulus and HTMX, nothing too fancy. Backend rendered by Symfony/Twig. Proper Http protocol handling, you know, good old simple UI.
I do have few more dependencies, like tailwindcss and some tiny js libs that are irrelevant for the sake of this conversation.
I'm not using any other JS frameworks, not even TypeScript, just ES - simplicity over all.
What I couldn't find anywhere is how to properly setup a test environment without a build system. Test frameworks like jest/mocha/jasmine seems to added recently a support for using ES imports instead of require however but I pretty much got stuck at importmaps and how to avoid installing same dependencies multiple times, once through impormaps and then through npm.
So here is my question, did anyone managed to setup a nobuild test env that would let him to test things like stimulus controllers through jsdom for example?
I have seen https://github.com/symfony/stimulus-testing however it's based on babel which defeats the purpose of not having a build system for the UI.
Beta Was this translation helpful? Give feedback.
All reactions