karma-cljs-test is an adapter for the Karma test runner, enabling it to execute tests written with the ClojureScript `cljs.test` testing framework. First published 11 years ago, its latest and only version is 0.1.0, indicating it is no longer actively maintained. The package integrates into Karma's configuration by specifying 'cljs-test' as a framework. Its utility is highly specialized for projects using ClojureScript with Karma, a combination that has largely been superseded by other testing approaches within the ClojureScript ecosystem, such as `doo` or direct integration with modern test runners via `shadow-cljs` output. The core dependency, Karma, has also been deprecated, further limiting this adapter's relevance and support. There is no ongoing release cadence.
npm install karma-cljs-testVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Karma configuration (`karma.conf.js`) for running ClojureScript tests using `karma-cljs-test`. It includes paths typical for ClojureScript compilation output and shows how to set the 'cljs-test' framework and client arguments for a ClojureScript test runner function.
Consider migrating to alternative ClojureScript testing setups, such as `doo` (for browser testing) or directly integrating with modern JavaScript test runners (e.g., Jest, Web Test Runner) via ClojureScript's ES module or CommonJS output targets with `shadow-cljs`. If Karma is absolutely required, use older, compatible versions of Node.js and Karma (e.g., Karma 0.12.x).
Plan a migration away from Karma to modern browser-based unit testing solutions like Web Test Runner or `jasmine-browser-runner`, or Node.js-based alternatives such as Jest or Vitest, which offer more performant and actively maintained options.
Carefully review and adjust the `files` array to precisely match the generated JavaScript artifacts from your specific ClojureScript compiler and build configuration. Ensure the correct loading order of the Google Closure Library, your compiled application code, and test runner. For `shadow-cljs`, consider using its built-in Karma target if available, or generating ESM/CommonJS modules and using a more modern test runner.
Always install the specific Karma version `~0.12.0` as indicated in the README. If you must use a newer Karma version, prepare for extensive debugging and potential re-implementation of parts of the adapter, or switch to a different ClojureScript testing solution.
Ensure `karma-cljs-test` is listed in your `package.json`'s `devDependencies` and installed via `npm install` or `yarn install`. Also, verify that Karma's `plugins` configuration (if explicitly defined) includes `karma-cljs-test`.
Check your `karma.conf.js` to ensure `frameworks: ['cljs-test']` is present. Confirm `karma-cljs-test` is installed in `node_modules`. If you have a custom `plugins` array in your Karma config, ensure it includes `'karma-cljs-test'`.
Ensure your Node.js version is compatible with the old Karma 0.12.x series. Configure your ClojureScript compiler to output CommonJS or legacy JavaScript that is compatible with the old browser environments Karma 0.12.x supports. Modern ClojureScript with ES modules will likely require a different test runner setup.
Verify that your ClojureScript project is compiling successfully and producing the JavaScript file containing `app.test_runner.run_with_karma` (or your equivalent test runner). Check the `files` array in `karma.conf.js` to ensure all necessary compiled ClojureScript files are included and loaded in the correct order.