{"id":21259820,"url":"https://github.com/epicmet/tme","last_synced_at":"2026-04-18T01:37:05.159Z","repository":{"id":103796916,"uuid":"398398880","full_name":"epicmet/tme","owner":"epicmet","description":"A simple testing app for Node and Web platform","archived":false,"fork":false,"pushed_at":"2021-08-20T21:01:46.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T06:43:05.647Z","etag":null,"topics":["nodejs","testing-tools","webapp"],"latest_commit_sha":null,"homepage":"","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/epicmet.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}},"created_at":"2021-08-20T20:59:17.000Z","updated_at":"2023-03-08T21:34:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"a15040b2-7f19-4588-b78f-68af47195747","html_url":"https://github.com/epicmet/tme","commit_stats":null,"previous_names":["epicmet/tme"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/epicmet/tme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicmet%2Ftme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicmet%2Ftme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicmet%2Ftme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicmet%2Ftme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epicmet","download_url":"https://codeload.github.com/epicmet/tme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epicmet%2Ftme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278591300,"owners_count":26012031,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["nodejs","testing-tools","webapp"],"created_at":"2024-11-21T04:15:20.949Z","updated_at":"2025-10-06T10:10:42.296Z","avatar_url":"https://github.com/epicmet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tme\n\ntme is a testing app that can test nodejs and web applications.\nI wrote this app by following [this](https://www.udemy.com/course/javascript-beginners-complete-tutorial/) tutorial by Stephen Grider.\n\n## Requirements\n\n- Node version 14.x and above\n- npm version 6.x and above\n\n## Installation\n\n1. clone this repo.\n2. go to the tme directory.\n3. install dependencies using npm.\n\n```npm\nnpm install\n```\n\n4. link this repo to your local computer using npm so you can access tme everywhere on your terminal.\n\n```npm\nnpm link\n```\n\n## Usage\n\nThe test files that you make should follow this pattern :\n\n```js\n*.test.js\n```\n\nInside those test file you can use _it_ and _beforeEach_ function to define you tests.\n\n### it\n\nThe _it_ function is the core part of this testing app. It accepts two arguments, a description of the test that will be shown on terminal and a callback function that is your actual test!\n\n```js\nit(\"DESCRIPTION\", testFunction);\n```\n\n### beforeEach\n\nThis pre-defined function accepts just a callback function that will execute before each test that was defined by _it_.\n\n```js\nbeforeEach(callbackFunction);\n```\n\nBut before defining your test with _it_ and _beforeEach_, you must to add some other code to your \\*.test.js files in order to work correctly and that depends on which platform your app is written in.\n\n## Nodejs\n\nIf you are testing a node application, do these instructions :\n\n1. require in each function that you want to test.\n\n```js\nconst { foo } = require(\"../index\");\n```\n\n2. require [assert](https://nodejs.org/dist/latest-v14.x/docs/api/assert.html#assert_assert) that is a pre-defined nodejs module.\n\n```js\nconst assert = require(\"assert\");\n```\n\n3. define your test using _it_ and _beforeEach_\n4. at the end of each test, use assert module to check what the test return and what do you expect it to return.\n\n## Web Apps\n\n1. require [assert](https://nodejs.org/dist/latest-v14.x/docs/api/assert.html#assert_assert) that is a pre-defined nodejs module.\n\n```js\nconst assert = require(\"assert\");\n```\n\n2. use async key word for _it_ callback function.\n3. at each test you should first render your main html file to the app.\n\n```js\nconst dom = await render(\"index.html\");\n```\n\n4. also if you want to dispatch action to dom then test something with it, use this syntax in your callback function : (For more information see [jsdom](https://github.com/jsdom/jsdom) documentation)\n\n```js\ndom.window.document\n  .querySelector(\"form\")\n  .dispatchEvent(new dom.window.Event(\"submit\"));\n```\n\n## Caution\n\nPlease take note that this app will run every thing that is writen in those \\*.test.js files. If there is some bad code that mess with your system via nodejs, it can cause many problems as jsdom [says](https://github.com/jsdom/jsdom#executing-scripts).\n\nSo just test and run test files that you wrote yourself. In that case there is absolutely nothing to be worry about.\n\n## Examples\n\nYou can find some examples by looking at tests in 'sampleNodeProject' and 'sampleWebProject' directories in this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicmet%2Ftme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepicmet%2Ftme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepicmet%2Ftme/lists"}