{"id":17160289,"url":"https://github.com/codenameyau/pubtest","last_synced_at":"2025-03-24T15:12:05.395Z","repository":{"id":19662772,"uuid":"22916048","full_name":"codenameyau/pubtest","owner":"codenameyau","description":":package: Browser console js unit tests","archived":false,"fork":false,"pushed_at":"2017-02-13T04:52:00.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T03:26:12.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/codenameyau.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-08-13T13:12:29.000Z","updated_at":"2017-02-13T04:36:14.000Z","dependencies_parsed_at":"2022-08-24T14:07:28.194Z","dependency_job_id":null,"html_url":"https://github.com/codenameyau/pubtest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fpubtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fpubtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fpubtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fpubtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenameyau","download_url":"https://codeload.github.com/codenameyau/pubtest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294775,"owners_count":20591909,"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-10-14T22:24:21.474Z","updated_at":"2025-03-24T15:12:05.376Z","avatar_url":"https://github.com/codenameyau.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"pubtest\n=======\n\n###Description\nWrite and run JavaScript unit tests in your browser console. It's a quick\nway to test ES5 code without a module loader.\n\n![pubtest-screenshot](https://cloud.githubusercontent.com/assets/3826772/22871237/07dd858e-f17d-11e6-8531-b2dbc530a9bd.png)\n\nRead [src/pubtest.js](https://github.com/codenameyau/pubtest/blob/master/src/pubtest.js#L45-L170) for all available assertions. Docs coming soon...\n\n## Installation\n\n##### Method 1: Manual\nAdd `build/pubtest.min.js` to your project.\n\n##### Method 2: Bower\n```\nbower install pubtest --save-dev\n```\n\n##Quick Guide\n\n#####`index.html`\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n\n  \u003cbody\u003e\n    \u003c!-- JavaScript source --\u003e\n    \u003cscript src=\"math.js\"\u003e\u003c/script\u003e\n\n    \u003c!-- Test suite --\u003e\n    \u003cscript src=\"pubtest.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"test-math.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\n\u003c/html\u003e\n```\n\n\n#####`math.js`\n```javascript\nvar sexyFactorial = function(n) {\n  return (n \u003c 2) ? 1 : n * sexyFactorial(n-1);\n};\n```\n\n\n#####`test-math.js`\n```javascript\n\n// Call the test whatever you want\nvar test = new PubTest('Maths');\n\n// Callback used for local scope\ntest.testCase(function() {\n\n  test.assertEqual(sexyFactorial(0), 1,\n    'factorial of 0 should equal 1');\n\n  test.assertEqual(sexyFactorial(1), 1,\n    'factorial of 1 should equal 1');\n\n  test.assertEqual(sexyFactorial(5), 120,\n    'factorial of 5 should equal 120');\n\n});\n\n// Show results in browser console (ctr+shift+j)\ntest.results();\n```\n\n### External Examples\n- https://github.com/codenameyau/forest-ecosystem/tree/master/public/test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fpubtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenameyau%2Fpubtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fpubtest/lists"}