rails / jsbundling-rails

Bundle and transpile JavaScript in Rails with esbuild, rollup.js, or Webpack.
MIT License
831 stars 143 forks source link

Configure Basic Testing / CI #184

Closed ksylvest closed 8 months ago

ksylvest commented 8 months ago

Some recent changes to how assets are built proved challenging no tests are run on this project. To fix, proposing some basic tests using selenium / capybara / minitest. I'm unsure on the how to confirm GitHub Actions (might be repo setting?), but locally the following works:

cd test/dummy && rake test:prepare
bin/test

Ideally this CI might use a matrix to test with bun / yarn / NPM. For now the default bun option is used. If maintainers are interested, the full matrix of tests are fairly easy in a followup.

zzak commented 8 months ago

Hey, I was just here to do the same, except I don't think we should use the dummy app pattern. It's a thing we're trying to get rid of in Rails, and I will open a PR to add something similar to this project.

ksylvest commented 8 months ago

Hey @zzak - thanks for commenting. I'm happy to nuke the dummy app. Do you have a link to a project configured the correct way?

ksylvest commented 8 months ago

NVM - think I found (https://github.com/rails/rails/pull/50427/commits/2fd5dc9473301a7ed3f01261b348ca015c6a28ad)...

I've split the core testing setup to this PR: https://github.com/rails/jsbundling-rails/pull/186

I can then check through introducing an actual test if you are OK with the other PR and close this.

zzak commented 8 months ago

@ksylvest Yeah, I'm not sure we need to send so many PRs until we have something meaty enough to merge. Happy to collaborate on this, and to avoid any back&forth feel free to reach out on discord (__zzak__) or @ me in the Rails discord.