{"id":19094679,"url":"https://github.com/risto-stevcev/cljsjs-sinon","last_synced_at":"2026-06-18T08:31:58.650Z","repository":{"id":66361937,"uuid":"58816337","full_name":"Risto-Stevcev/cljsjs-sinon","owner":"Risto-Stevcev","description":"CLJSJS package for Sinon JS","archived":false,"fork":false,"pushed_at":"2016-07-18T21:48:33.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T08:27:02.387Z","etag":null,"topics":["clojurescript","sinon"],"latest_commit_sha":null,"homepage":"https://clojars.org/cljsjs/sinon","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Risto-Stevcev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-05-14T15:53:30.000Z","updated_at":"2017-08-07T09:50:59.000Z","dependencies_parsed_at":"2023-02-22T12:46:26.834Z","dependency_job_id":null,"html_url":"https://github.com/Risto-Stevcev/cljsjs-sinon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Risto-Stevcev/cljsjs-sinon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Fcljsjs-sinon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Fcljsjs-sinon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Fcljsjs-sinon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Fcljsjs-sinon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Risto-Stevcev","download_url":"https://codeload.github.com/Risto-Stevcev/cljsjs-sinon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Risto-Stevcev%2Fcljsjs-sinon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34483275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["clojurescript","sinon"],"created_at":"2024-11-09T03:30:56.590Z","updated_at":"2026-06-18T08:31:58.621Z","avatar_url":"https://github.com/Risto-Stevcev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cljsjs/sinon\n\n[![Clojars](https://img.shields.io/clojars/v/cljsjs/sinon.svg?maxAge=2592000)](https://clojars.org/cljsjs/sinon)\n\nStandalone test spies, stubs and mocks for JavaScript.\n\nAfter adding the dependency to your project you can require the packaged library like so:\n\n```clojure\n(ns application.core\n  (:require cljsjs.sinon))\n```\n\n## Examples\n\n```clojure\n(ns test-sinon.core\n  (:require [cljsjs.sinon]\n            [ajax.core :refer [GET]]))\n\n(enable-console-print!)\n\n\n;; Create a spy\n(def myobj (clj-\u003ejs {\"hello\" (fn [name] (str \"hello, \" name \"!\"))}))\n(def spy (js/sinon.spy myobj \"hello\"))\n\n(assert (false? (.-calledOnce spy)))\n(println (myobj.hello \"mister\")) ; hello, mister!\n(assert (true? (.-calledOnce spy)))\n(assert (true? (.calledWith spy \"mister\")))\n\n\n;; Create a fake server\n(def server (js/sinon.fakeServer.create))\n(def mock-response [{\"id\" 12 \"comment\" \"Hey there\"}])\n\n(.respondWith server \"GET\" \"/some/article/comments.json\"\n  (clj-\u003ejs [200 {\"Content-Type\" \"application/json\"} (-\u003e mock-response clj-\u003ejs js/JSON.stringify)]))\n\n(def callback (js/sinon.spy))\n(GET \"/some/article/comments.json\" {:handler callback})\n(.respond server)\n(js/sinon.assert.calledWith callback mock-response)\n```\n\n## Important\n\nIt's important to note that Sinon isn't meant to be used in production or fed through minifiers. It's actual use case is either for unit testing or to mock a backend during frontend development. Therefore, it should always be run with `optimizations :none`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristo-stevcev%2Fcljsjs-sinon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fristo-stevcev%2Fcljsjs-sinon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fristo-stevcev%2Fcljsjs-sinon/lists"}