{"id":11197,"library":"karma-cljs-test","title":"Karma ClojureScript Test Adapter","description":"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.","status":"abandoned","version":"0.1.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/honzabrecka/karma-cljs-test","tags":["javascript","karma-plugin","karma-adapter","clojurescript","cljs.test","cljs"],"install":[{"cmd":"npm install karma-cljs-test","lang":"bash","label":"npm"},{"cmd":"yarn add karma-cljs-test","lang":"bash","label":"yarn"},{"cmd":"pnpm add karma-cljs-test","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as the test runner to integrate the cljs.test framework. The adapter was built against Karma ~0.12.0.","package":"karma","optional":false}],"imports":[{"note":"This package is a Karma plugin/adapter. It is not imported directly into userland JavaScript/TypeScript code. Instead, it is loaded by Karma via its configuration file (karma.conf.js) by adding 'cljs-test' to the 'frameworks' array.","wrong":"import { CljsTest } from 'karma-cljs-test'","symbol":"karma.conf.js frameworks array","correct":"config.set({\n  frameworks: ['cljs-test'],\n  // ...\n});"}],"quickstart":{"code":"/* karma.conf.js */\nmodule.exports = function(config) {\n  var root = 'target/public/dev'; // Adjust this path to your ClojureScript compiled output\n\n  config.set({\n    // Base path that will be used to resolve all relative paths for files and exclude.\n    basePath: '',\n\n    // Frameworks to use\n    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n    frameworks: ['cljs-test'],\n\n    // List of files / patterns to load in the browser\n    // These files are loaded in order. Ensure your ClojureScript runtime and application code are loaded before tests.\n    files: [\n      root + '/goog/base.js',\n      root + '/cljs_deps.js',\n      root + '/app.js', // Your main application/test runner entry point\n      {pattern: root + '/*.js', included: false},\n      {pattern: root + '/**/*.js', included: false}\n    ],\n\n    // List of files to exclude\n    exclude: [],\n\n    // Client configuration for ClojureScript tests\n    client: {\n      args: ['app.test_runner.run_with_karma'] // Replace with your actual ClojureScript test runner function\n    },\n\n    // Test results reporter to use\n    // possible values: 'dots', 'progress'\n    // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n    reporters: ['progress'],\n\n    // Web server port\n    port: 9876,\n\n    // Enable / disable colors in the output (reporters and logs)\n    colors: true,\n\n    // Level of logging\n    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n    logLevel: config.LOG_INFO,\n\n    // Enable / disable watching file and executing tests whenever any file changes\n    autoWatch: true,\n\n    // Start these browsers\n    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher\n    browsers: ['Chrome'],\n\n    // Continuous Integration mode\n    // if true, Karma captures browsers, runs the tests and exits\n    singleRun: false,\n\n    // Concurrency level\n    // how many browser should be started simultaneously\n    concurrency: Infinity\n  });\n};\n\n// To install:\n// npm install --save-dev karma@~0.12.0 karma-cljs-test@~0.1.0 karma-chrome-launcher","lang":"javascript","description":"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."},"warnings":[{"fix":"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).","message":"The `karma-cljs-test` package is 11 years old (v0.1.0) and has not received updates since July 2015. It is highly unlikely to be compatible with modern Node.js versions, recent Karma releases, or current ClojureScript compilation toolchains (e.g., `shadow-cljs`) without significant issues or manual patching.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"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.","message":"The Karma test runner itself, the fundamental dependency for `karma-cljs-test`, has been officially deprecated. While critical security fixes may be provided for a limited time, active development and new features have ceased, impacting the long-term viability and support for any Karma-based testing solution.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"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.","message":"The `files` configuration in `karma.conf.js` is highly specific to the ClojureScript compilation output and project structure of the era when this package was active. Paths like `root + '/goog/base.js'` and `root + '/cljs_deps.js'` assume a Google Closure Compiler-based build without advanced optimizations, common with `lein-cljsbuild`. Modern ClojureScript build tools like `shadow-cljs` might produce different file structures or integrate testing differently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"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.","message":"The adapter requires Karma `~0.12.0`. Attempting to use it with significantly newer versions of Karma (e.g., 1.x, 2.x, or the current 6.x) is very likely to lead to incompatibility errors due to breaking changes in Karma's API over time.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"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`.","cause":"The package was not installed or is not correctly discoverable by Karma.","error":"Cannot find module 'karma-cljs-test'"},{"fix":"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'`.","cause":"Karma cannot find or load the `karma-cljs-test` plugin, usually because it's not installed or not correctly specified in the `frameworks` array.","error":"Error: Can not load 'cljs-test' framework!"},{"fix":"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.","cause":"Running `karma-cljs-test` (and the older Karma versions it relies on) in a modern Node.js environment or with ClojureScript outputting ES modules can cause conflicts, as the toolchain was built for CommonJS and older JavaScript runtimes.","error":"SyntaxError: Unexpected token 'export' (or similar errors related to ES modules in CJS context)"},{"fix":"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.","cause":"The ClojureScript test runner function specified in `client.args` either doesn't exist, is misspelled, or hasn't been properly compiled and loaded into the browser context by Karma.","error":"TypeError: Cannot read properties of undefined (reading 'run_with_karma')"}],"ecosystem":"npm"}