// the find
jfirebaugh/konacha
Test your Rails application's JavaScript with the mocha test framework and chai assertion library
Konacha is a Rails engine that runs JavaScript specs (Mocha + Chai) through the asset pipeline, letting you require app assets the same way you would in a Rails view. It's aimed at Rails apps from the Sprockets era that want JS unit tests without pulling in a separate frontend build toolchain.
Deep asset pipeline integration means specs can require individual JS files via Sprockets directives and get real dependency resolution, not a hand-maintained script list. Running specs in an isolated iframe per file avoids the global-state bleed you get with concatenated test bundles. The CLI runner mimics RSpec's formatter protocol, so it plugs into existing RSpec-based CI reporting (ci_reporter, etc.) instead of inventing its own output format.
Last commit is from 2019 and it explicitly requires Sprockets/the classic asset pipeline, which most Rails apps have since dropped for Webpacker, jsbundling-rails, or import maps — this only fits a shrinking pool of legacy codebases. Browser-driven specs depend on Capybara + a driver (Selenium or Poltergeist/PhantomJS), and PhantomJS has been dead for years, so the documented setup path is largely broken today. No support for HTML fixtures/templates beyond Sprockets JST, so anything more complex than a static template string needs a separate gem (konacha-chai-matchers) that's similarly unmaintained. Mocha and Chai are vendored as git submodules pinned at whatever version was current in 2019, so you're stuck with old assertion/runner behavior unless you fork and rebuild the vendored assets yourself.