Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

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.

You must be logged in to vote

Replies: 2 comments

Comment options

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

You must be logged in to vote
0 replies
Comment options

any news here?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.