{"id":18304575,"url":"https://github.com/numtel/velocity-tinytest","last_synced_at":"2025-04-09T10:36:44.779Z","repository":{"id":22229227,"uuid":"25562247","full_name":"numtel/velocity-tinytest","owner":"numtel","description":"Use Tinytest with Velocity","archived":false,"fork":false,"pushed_at":"2014-12-05T21:58:18.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T04:42:29.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/numtel.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}},"created_at":"2014-10-22T04:51:08.000Z","updated_at":"2014-12-05T21:58:18.000Z","dependencies_parsed_at":"2022-08-20T10:50:15.498Z","dependency_job_id":null,"html_url":"https://github.com/numtel/velocity-tinytest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fvelocity-tinytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fvelocity-tinytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fvelocity-tinytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fvelocity-tinytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtel","download_url":"https://codeload.github.com/numtel/velocity-tinytest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248021380,"owners_count":21034652,"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-11-05T15:29:25.826Z","updated_at":"2025-04-09T10:36:44.747Z","avatar_url":"https://github.com/numtel.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numtel:velocity-tinytest\n\nUse Tinytest to test your Meteor app, just like you would a package.\n\nIf you would like to use Tinytest with your app but without Velocity, see my\n[numtel:tinytest-in-app](https://github.com/numtel/tinytest-in-app) package.\n\n## Installation\n\n**This package has been removed from Atmosphere due to breaking changes in Velocity's API.**\n\nThe `tinytest` package is included automatically.\n\n## Quick start\n\n1. Add a test to a `.js` or `.coffee` file inside `tests/tinytest`\n    ```javascript\n    Tinytest.add('test title', function(test){\n      test.equal(true, true);\n    });\n    ```\n\n2. To view the results, install the Velocity HTML Reporter:\n    ```bash\n    $ meteor add velocity:html-reporter\n    ```\n\n## Tinytest documentation\n\nSince there is no official documentation for Tinytest, it may be helpful to have\nsome here.\n\nTest titles can be any string. Use a separator of `\" - \"` to define sections.\n\n**Test Syntax:**\n```javascript\n// Synchronous test\nTinytest.add('test title', function(test){\n  test.equal(true, true);\n});\n\n// Asynchronous test\nTinytest.addAsync('async test title', function(test, onComplete){\n  Meteor.setTimeout(function(){\n    test.equal(true, true);\n    onComplete();\n  }, 1000);\n});\n```\n\n**Assertions:**\n```javascript\ntest.isFalse(v, msg) // if (!v)\ntest.isTrue(v, msg) // if(v)\ntest.equal(actual, expected, message)\ntest.notEqual(actual, expected, message)\ntest.length(obj, len, msg)\ntest.include(s, v) // s = string or object\ntest.isNaN(v, msg)\ntest.isUndefined(v, msg)\ntest.isNotNull(v, msg)\ntest.isNull(v, msg)\n\n// expected can be:\n//  undefined: accept any exception.\n//  string: pass if the string is a substring of the exception message.\n//  regexp: pass if the exception message passes the regexp.\n//  function: call the function as a predicate with the exception.\ntest.throws(func, expected)\n\ntest.instanceOf(obj, klass)\n\ntest.runId() // Unique id for this test run\n\n// Call this to fail the test with an exception. Use this to record\n// exceptions that occur inside asynchronous callbacks in tests.\n//\n// It should only be used with asynchronous tests, and if you call\n// this function, you should make sure that (1) the test doesn't\n// call its callback (onComplete function); (2) the test function\n// doesn't directly raise an exception.\ntest.exception(exception)\n\ntest.expect_fail()\n```\n\n## Related packages\n* [numtel:tinytest-fixture-account](http://github.com/numtel/tinytest-fixture-account) - Create a fixture account for tests, remove when done\n* [numtel:tinytest-in-app](https://github.com/numtel/tinytest-in-app) - Use Tinytest in a Meteor app without Velocity\n\n## Todo\n\n* Make tests post results one at a time as they come in instead of in big groups after each location (Server/Client)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fvelocity-tinytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtel%2Fvelocity-tinytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fvelocity-tinytest/lists"}