{"id":28194232,"url":"https://github.com/monkey-projects/shadow-junit-xml","last_synced_at":"2025-05-16T13:11:56.154Z","repository":{"id":184161835,"uuid":"671411270","full_name":"monkey-projects/shadow-junit-xml","owner":"monkey-projects","description":"Reporter for JUnit xml generation with Shadow-cljs","archived":false,"fork":false,"pushed_at":"2024-08-16T05:50:52.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-10T15:18:21.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkey-projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-27T08:56:44.000Z","updated_at":"2024-08-16T05:50:55.000Z","dependencies_parsed_at":"2024-06-06T11:07:21.880Z","dependency_job_id":"6ff8263f-f3e7-4455-88cd-5f2b5b47aaac","html_url":"https://github.com/monkey-projects/shadow-junit-xml","commit_stats":null,"previous_names":["monkey-projects/shadow-junit-xml"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fshadow-junit-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fshadow-junit-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fshadow-junit-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fshadow-junit-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkey-projects","download_url":"https://codeload.github.com/monkey-projects/shadow-junit-xml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535799,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-16T13:11:40.793Z","updated_at":"2025-05-16T13:11:56.149Z","avatar_url":"https://github.com/monkey-projects.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MonkeyProjects Shadow-cljs JUnit XML Reporter\n\nThis is a [ClojureScript](https://cljs.info) library that provides a\nreporter for [Shadow-cljs](https://github.com/thheller/shadow-cljs)\nunit tests that outputs as [JUnit](https://junit.org) xml.  This\nmakes it useful for improving test reporting in various build pipeline\ntools.\n\n## Why?\n\n\"Doesn't this already exist somewhere?\" I hear you say.  I thought so\ntoo, but I could not find any library that allowed this.  Yes, there\nis [Kaocha](https://github.com/lambdaisland/kaocha), but as far as I\ncan tell, it doesn't provide support for JUnit in cljs, when running\nit as a plain Node script.  Also, the [cljs2](https://github.com/lambdaisland/kaocha-cljs2)\nadds [a lot of complexities](https://github.com/lambdaisland/funnel)\nway beyond just running it as plain JavaScript.  This is not really\na problem when running it locally.  In fact, this lib also provides\na configuration for doing just that.  But in a CI/CD pipeline, having\nto start an additional service just to be able to output JUnit xml\nwas going a bit too far for me.\n\n## Usage\n\n[![Clojars Project](https://img.shields.io/clojars/v/com.monkeyprojects/shadow-junit-xml.svg)](https://clojars.org/com.monkeyprojects/shadow-junit-xml)\n\nIt's quite simple.  Actually, this library [uses it too](shadow-cljs.edn).\nI assume you've already [set up your Shadow-cljs project](https://shadow-cljs.github.io/docs/UsersGuide.html#_usage_).\nThen add the library as a dependency in your `shadow-cljs.edn`:\n```clojure\n...\n:dependencies [...\n               [com.monkeyprojects/shadow-junit-xml \"\u003cRELEASE\u003e\"]]\n...\n```\n\nNext, add a build that targets `node-test` and use this library's test\nrunner as your `main`, like this:\n\n```clojure\n{:builds\n {:test-ci\n  {:target :node-test\n   :output-to \"target/js/node-tests.js\"\n   ;; Output as junit xml\n   :main monkey.shadow.junit.runner/run-tests}}}\n```\n\nThen compile the code:\n```bash\n$ npx shadow-cljs compile test-ci\n```\nThis will generate a JavaScript file as configured in the `output-to` property.\nThen run it using [nodejs](https://nodejs.org/):\n```bash\n$ node target/js/node-tests.js\n```\n\nThis will run your unit tests and output the result as JUnit xml to `stdout`.\nIn order to save it to a file, redirect `stdout`:\n```bash\n$ node target/js/node-tests.js 1\u003ejunit.xml\n```\nIn the above example, `junit.xml` should now contain the test results in JUnit\nformat, which you can then pass on to your CI/CD tool!\n\n## LICENSE\n\nCopyright (c) 2023-2024 by [Monkey Projects BV](https://www.monkey-projects.be).\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fshadow-junit-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkey-projects%2Fshadow-junit-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fshadow-junit-xml/lists"}