{"id":13400806,"url":"https://github.com/markvanderloo/tinytest","last_synced_at":"2025-10-21T20:05:34.536Z","repository":{"id":34764512,"uuid":"168725705","full_name":"markvanderloo/tinytest","owner":"markvanderloo","description":"A lightweight, no-dependency, but full-featured package for unit testing in R","archived":false,"fork":false,"pushed_at":"2024-08-10T16:51:11.000Z","size":849,"stargazers_count":223,"open_issues_count":26,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-11T10:19:40.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markvanderloo.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":"2019-02-01T16:22:04.000Z","updated_at":"2024-09-24T00:42:27.000Z","dependencies_parsed_at":"2023-02-19T12:01:19.804Z","dependency_job_id":"ade3f3da-cfc2-4d2d-b6aa-0175b7eaa96f","html_url":"https://github.com/markvanderloo/tinytest","commit_stats":{"total_commits":413,"total_committers":15,"mean_commits":"27.533333333333335","dds":0.07021791767554475,"last_synced_commit":"991d6fed95d10054c4f414be31d549ca92c6cf5b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markvanderloo%2Ftinytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markvanderloo%2Ftinytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markvanderloo%2Ftinytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markvanderloo%2Ftinytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markvanderloo","download_url":"https://codeload.github.com/markvanderloo/tinytest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243537935,"owners_count":20307098,"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":"2024-07-30T19:00:55.687Z","updated_at":"2025-10-21T20:05:29.496Z","avatar_url":"https://github.com/markvanderloo.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"[![CRAN](https://www.r-pkg.org/badges/version/tinytest)](https://cran.r-project.org/package=tinytest/)\n[![status](https://tinyverse.netlify.app/badge/tinytest)](https://CRAN.R-project.org/package=tinytest)\n[![Downloads](https://cranlogs.r-pkg.org/badges/tinytest)](https://cran.r-project.org/package=tinytest/)\n\n\n# tinytest \u003cimg src=\"img/logo_tinytest.png\" width=\"150\" align=\"right\" alt=\"tinytest has no logo\" /\u003e\n\nA lightweight, no-dependency, full-featured package for unit testing \n\n\n[Overview of functionality](pkg/README.md), or [Watch my talk at useR!2021](https://youtu.be/-PsaqMWfUIg?t=1104)\n\n## Installing tinytest\n\n### From CRAN\n\nIn `R`, do\n```r\ninstall.packages(\"tinytest\")\n```\n\n### From GitHub\n\nIn your (bash) shell, do\n\n```bash\ngit clone https://github.com/markvanderloo/tinytest\ncd tinytest\nmake install\n```\n\n![onwards to the tinyverse](img/growth.png)\n\n## tinytest philosophy.\n\n### Testing should be as easy as possible. \n\nTesting infrastructure must not get in the way of the developer. Setting up\ntests should be done with ease. In `tinytest` tests are simple R-scripts\nwhere test statements can be interspersed with other code (e.g. to prepare\nsome results for testing).\n\n\n### Test results are data\n\n\nThe purpose of testing is to  gather evidence (data) that builds confidence in\nthe quality of software. Unit tests consist of expressions where an expected\nresult is compared with the result of a program or function. For example:\n\n```r\naddOne \u003c- function(x) x + 1\nsubOne \u003c- function(x) x - 2\n\n# this test should pass\ntinytest::expect_equal(addOne(1), 2 )\n\n# this test will fail\ntinytest::expect_equal(subOne(2), 1 ) \n```\n\nSome unit testing frameworks for R throw a formal exception (error) whenever a\ntest fails. There are several reasons why this is not a good idea.\n\n1. You do not need to throw an error to discover that a test has failed. A boolean\nresult is in principle enough.\n2. A [traceback](https://www.rdocumentation.org/packages/base/versions/3.5.2/topics/traceback)\nof the error does not give you any information on the cause of the test\nfailure. This is because the test function throws the error, not the tested\ncode.\n3. Throwing errors complicates the code needed for developing a testing suite,\nmaking testing suites harder to maintain and possibly more complex to use than\nnecessary.\n\n`tinytest` therefore treats test results as data, not as exceptions. This data\ncan be summarized and investigated by any method you already know in R.\n\n### Error on deploy\n\nThere is a case where the failure of a test should cause an error, namely when\ntesting for deployment (e.g. publishing a package on CRAN). Therefore, when\nrunning `R CMD check`, an error will be thrown if a test has failed. This way\nthe error interrupts the _deployment_ process instead of the _testing_ process.\n\n\n### Run all tests\n\nBy default all tests are run and the results are summarized to one line of\noutput per failed test.\n\n### Tests are installed with the package\n\nSo a package author can request test results from users that installed the package.\n\n\n### Show you what you need\n\nDeveloping and debugging takes focus and often deep concentration. `tinytest`\nsupports your workflow by directing you as quickly as possible\nto the source of the test failure. In a single line of output you get the\ntest result, the file and location in the file, and the test call that failed.\nOf course, printing is configurable through options.\n\n### Light weight is the right weight\n\nKeep it simple, keep it clean. See  [tinyverse.org](https://www.tinyverse.org).\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkvanderloo%2Ftinytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkvanderloo%2Ftinytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkvanderloo%2Ftinytest/lists"}