{"id":18898402,"url":"https://github.com/hychen/ke-e","last_synced_at":"2026-02-04T02:41:50.796Z","repository":{"id":57269825,"uuid":"54298912","full_name":"hychen/ke-e","owner":"hychen","description":"假的 (ké--ê) is a property-based testing library, inspired by QuickCheck, Hypothesis, JSVerify and faker.js.","archived":false,"fork":false,"pushed_at":"2017-05-30T06:30:24.000Z","size":2206,"stargazers_count":26,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T08:22:27.075Z","etag":null,"topics":["quickcheck"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hychen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-20T03:37:23.000Z","updated_at":"2025-01-24T01:37:12.000Z","dependencies_parsed_at":"2022-09-02T12:31:05.462Z","dependency_job_id":null,"html_url":"https://github.com/hychen/ke-e","commit_stats":null,"previous_names":["hychen/hycheck"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/hychen/ke-e","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hychen%2Fke-e","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hychen%2Fke-e/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hychen%2Fke-e/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hychen%2Fke-e/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hychen","download_url":"https://codeload.github.com/hychen/ke-e/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hychen%2Fke-e/sbom","scorecard":{"id":474911,"data":{"date":"2025-08-11","repo":{"name":"github.com/hychen/ke-e","commit":"2a632975014f92b8def0a2caf4020fb2332e8ddf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"39 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-vfrc-7r7c-w9mx","Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-7px7-7xjx-hxm8","Warn: Project is vulnerable to: GHSA-x5pg-88wf-qq4p","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T15:02:08.759Z","repository_id":57269825,"created_at":"2025-08-19T15:02:08.759Z","updated_at":"2025-08-19T15:02:08.759Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29065066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T01:55:38.219Z","status":"online","status_checked_at":"2026-02-04T02:00:07.999Z","response_time":62,"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":["quickcheck"],"created_at":"2024-11-08T08:42:31.644Z","updated_at":"2026-02-04T02:41:50.753Z","avatar_url":"https://github.com/hychen.png","language":"TypeScript","readme":"[![Build Status](https://travis-ci.org/hychen/ke-e.svg?branch=master)](https://travis-ci.org/hychen/ke-e)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://badges.mit-license.org/)\n\n# ké--ê\n\n`ké--ê` is a property-based testing library, inspired by [QuickCheck](https://hackage.haskell.org/package/QuickCheck),\n[Hypothesis](https://github.com/HypothesisWorks/hypothesis-python), [JSVerify](https://github.com/jsverify/jsverify) and\n[faker.js](https://github.com/marak/Faker.js/).\n\nIt is also available to generate fake data for many purpose like faker.js.\n\n## What is ké--ê?\n\n假的 (ké--ê) is a Taiwanese word. the meaning is fake things in English.\n\n## Features\n\n- Property-based test utilities library.\n- Repeatable random fake data generators.\n- Mocha test framwork integration.\n- Support for multiple localities.\n- Support for browser and Node.js.\n\ncheck [documents](http://hychen.me/ke-e/index.html) for more details.\n\n### Property-Based Testing\n\nProperty-based tests make statements about the output of your code based on the input, and these statements\nare verified for many different possible inputs.\n\nBy default, `ke.hold` runs 50 tests. it reports a counter example does not satisfy the property\nif any test fail.\n\nfor example, the following test.\n\n```\ndescribe('Int', () =\u003e {\n  ke.hold(\n    '\u003e 0',       // property name.\n    x =\u003e x \u003e 0   // predicate.\n  )\n  .over(0)       // first especially case.\n  .over(2)       // second especially case.\n  .over(ke.int)  // universal case.\n})\n```\n\nwill report:\n\n```\n1) Int \u003e 0:\n\n      AssertionError: \u003e 0 doesn't hold, counter example: -5, tried: 1/100\n      + expected - actual\n\n      -false\n      +true\n```\n\n### Exception-Based Testing\n\nYou can still use `chai` to do the testing with random test values\ngenerated by `ke-e`.\n\n```\ndescribe('Nat', () =\u003e {\n  it('\u003e= 0',  () =\u003e {\n    ke.forall(ke.nat).eval((n) =\u003e {\n      expect(n \u003e= 0).eq(true);\n    });\n  }\n})\n```\n\n### Repeatable\n\ntest results are repeatable.\n\n```\n$ mocha\n1) Int \u003e0:\nAssertionError: \u003e0 doesn't hold, seed: -1764850555, counter example: -5265798245849472, tried: 3/3`\n\n```\n\n```\nSeed=-1764850555 mocha\n1) Int \u003e0:\nAssertionError: \u003e0 doesn't hold, seed: -1764850555, counter example: -5265798245849472, tried: 3/3`\n```\n\n### Localization\n\nThis project follows unicode CLDR specification. `en` is default locale id.\n\n```\n// Generate English first name.\nke.person.firstName.random.\n\n// Generate Transitional Chinese first name.\nke.person.firstName.locale('zh-Hant-TW').random.\n```\n\n### Node.js REPL\n\n```\n$ ke\n\u003e ke.int.random\n123124343\n```\n\n## Arbitraries\n\nThe purpose of a arbitraries is random generation and shrinking of values\nin property-based testing, but you could use them to generate fake data\nindividually.\n\nsome of definitions of arbitraries took from\n[faker.js](https://github.com/marak/Faker.js/) project.\n\n### Primitive\n\n- any - produce any primitive types.\n- boolean — produce true and false with equal probability.\n- falsy — produce falsy values: false, null, undefined, '', 0, and NaN.\n- nat — produce a natural number.\n- int — produce a integer.\n- pint — produce a positive integer.\n- nint — produce a negative integer.\n- num — produce a float numbers.\n- pnum — produce a positive float numbers.\n- nnum — produce negative float numbers.\n- char — produce a unicode character.\n- asciichar — produce an ascii character.\n- string — produce a unicode string.\n- nestring - produce a non-empty unicode string.\n- asciistring — produce an ascii string.\n- neasciistring — produce an non-empty ascii string.\n\n### Combinator\n\n- constant — produce a constant value.\n- elements — produce one of the given values.\n- regex - produce a value from the regular expression.\n- frequency - Choose one of the given arbitraries, with a weighted random distribution.\n- oneOf — randomly uses one of the given generators.\n- maybe - produce a value or null.\n- array — produce an array.\n- nearray — produce a non-empty array.\n- sequence — produce an array of given arbitraries in order.\n- object — produce an object.\n- impl - produce a instance of class C.\n- call - produces a value of function with given arbitrary arguments.\n- func — produce a function.\n- genfunc - produce a generator.\n- promise - produce a promise.\n- recursive - produce a recursive value.\n\n### Locale\n\n- locale\n - localeids — produce a locale id.\n - country\n - timezone\n\n### Datetime\n\n- date — produce a Date.\n\n### Literate\n- literate\n - word\n - words\n - sentence\n - sentences\n - paragraph\n - paragraphs\n - lines\n - text\n\n### Person\n\n- person - produce an object to reprsent a person.\n - name - produce the name of a person.\n - firstName - produce the first name of a person.\n - lastName - produce the last name of a person.\n - gender - produce the gender of a person.\n\n### Internet\n\n- internet\n - avatar - produce an avatar uri.\n - userName - produce a internet username.\n - password - produce a password string.\n - email - produce an email.\n - url - produce an url.\n\n### Location\n\n- location\n - address\n - streetAddress\n - state\n   - abbr\n - zipCode\n - county\n - city\n - street\n - buildingNumber\n - latitude -  produce an latitude.\n - longitude - produce an longitude.\n - coordinates -  produce a coordinates.\n\n### Grahpic\n\n- graphic\n  - color\n    - rgba\n    - hsla\n    - hsva\n    - hex\n    - hexCode\n  - image\n    - imageURL - an image url.\n    - grayImageURL - a gray image url.\n\n## Installation\n\n### Node.js\n\ninstall the module with: npm install ke-e\n\n```javascript\nimport ke from `ke-e`\n\ndescribe('Integer', () =\u003e {\n  ke.hold(\n    'x + y = y + x'\n    (x, y) =\u003e x + y === y + x\n    ).over(ke.int, ke.int);\n});\n```\n\n### Browser using script tag\n\nDownload ke-e.js and place it in your project, then add it as the follwoing.\n\n\u003cerror\u003e dones not work now.\n\n```html\n\u003cscript src=\"http://hychen.me/ke-e/ke-e.js\"\u003c/script\u003e\n\u003cscript\u003e\ndescribe('Integer', () =\u003e {\n  ke.hold(\n    'x + y = y + x'\n    (x, y) =\u003e x + y === y + x\n    ).over(ke.int, ke.int);\n});\n\u003c/script\u003e\n```\n\n## Get Involved\n\n- source code : [github.com/hychen/ke-e](https://github.com/hychen/ke-e).\n\n## License\n\nThe MIT License (MIT)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhychen%2Fke-e","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhychen%2Fke-e","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhychen%2Fke-e/lists"}