{"id":23155221,"url":"https://github.com/onesy-me/test","last_synced_at":"2026-05-04T10:35:38.801Z","repository":{"id":44306862,"uuid":"455233139","full_name":"onesy-me/test","owner":"onesy-me","description":"Test suite for front end and back end ","archived":false,"fork":false,"pushed_at":"2025-09-29T20:37:43.000Z","size":784,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T02:38:53.085Z","etag":null,"topics":["amaui","assert","browser","expect","express","expressjs","javascript","js","library","node","nodejs","test","test-framework","testing","testing-framework","testing-library","tests","typescript","utils","web"],"latest_commit_sha":null,"homepage":"https://docs.onesy.me/library/test","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/onesy-me.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":"2022-02-03T16:06:45.000Z","updated_at":"2025-09-29T20:37:47.000Z","dependencies_parsed_at":"2024-12-15T13:11:46.438Z","dependency_job_id":null,"html_url":"https://github.com/onesy-me/test","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"75249c34e4ffe3434fd04639b31da6e9e105ca29"},"previous_names":["onesy-me/amaui-test","amaui-org/amaui-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onesy-me/test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Ftest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Ftest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Ftest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Ftest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onesy-me","download_url":"https://codeload.github.com/onesy-me/test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onesy-me%2Ftest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32604548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["amaui","assert","browser","expect","express","expressjs","javascript","js","library","node","nodejs","test","test-framework","testing","testing-framework","testing-library","tests","typescript","utils","web"],"created_at":"2024-12-17T20:28:02.214Z","updated_at":"2026-05-04T10:35:38.794Z","avatar_url":"https://github.com/onesy-me.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cp align='center'\u003e\n  \u003ca target='_blank' rel='noopener noreferrer' href='#'\u003e\n    \u003cimg width='auto' height='84' src='https://raw.githubusercontent.com/onesy-me/onesy/refs/heads/main/utils/images/logo.png' alt='onesy logo' /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align='center'\u003eonesy Test\u003c/h1\u003e\n\n\u003cp align='center'\u003e\n  Test suite for front-end and back-end\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003ch3 align='center'\u003e\n  \u003csub\u003eMIT license\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eProduction ready\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eUMD 32.7kb gzipped\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003e100% test cov\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eBrowser and Nodejs\u003c/sub\u003e\n\u003c/h3\u003e\n\n\u003cp align='center'\u003e\n  \u003csub\u003eVery simple code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eModern code\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eJunior friendly\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eTypescript\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003c/sub\u003e\n  \u003csub\u003eMade with :yellow_heart:\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n### Add\n\n```sh\nyarn add @onesy/test --dev\n```\n\n### Use\n\n#### **Nodejs**\n\nYou can have onesy-test options either in package.json in 'onesy-test' property or onesy-test.options.js file in root directory, where `onesy-test` command will be made.\n\nIn nodejs on onesy-test run errors onesy-test exits the process, so it's all good if the command is flow dependent.\n\n*onesy-test.options.js*\n\n```javascript\n  module.exports = {\n    imports: [\n      'ts-node/register/transpile-only'\n    ],\n    files: [\n      'test/**/*.test.ts'\n    ]\n  }\n```\nor\n\n*package.json*\n\n```javascript\n  {\n    \"scripts\": {\n      test: \"onesy-test\"\n    },\n    \"onesy-test\": {\n      imports: [\n        'ts-node/register/transpile-only'\n      ],\n      files: [\n        'test/**/*.test.ts'\n      ]\n    }\n  }\n```\n\nAnd with yarn test or npm test command onesy-test will run all the tests based on the onesy-test options\n\n```javascript\nyarn test\n```\n\n#### **Browser**\n\nMake an OnesyTest instance, which will prepare the environment, write all the tests below it, and run the tests with `onesyTest.run()` method, which on errors throws an error, so if the tests passing is flow dependent, running tests will obviously stop the method having thrown an error on tests not having passed.\n\n```javascript\n  import { OnesyTest, assert } from '@onesy/test';\n  import { wait } from '@onesy/utils';\n\n  const onesyTest = new OnesyTest();\n\n  to('a', () =\u003e {\n    assert(4).eq(4);\n  });\n\n  group('@onesy/a1', () =\u003e {\n\n    pre(async () =\u003e {\n      await wait(140);\n\n      throw new Error('a');\n    });\n\n    to('a2', async () =\u003e {\n      await wait(140);\n\n      assert(4).eq(4);\n    });\n\n    group('@onesy/a3', () =\u003e {\n\n      to('a3', async () =\u003e {\n        assert(function a() { }).eq(undefined);\n      });\n\n    });\n\n    to('a4', () =\u003e {\n      [1, 2, 3, 4].forEach(value =\u003e {\n        assert(typeof value === 'number').true;\n\n        throw new Error('a');\n      });\n    });\n\n    group('@onesy/a5', () =\u003e {\n      let a: any;\n\n      pre(async () =\u003e {\n        await wait(14);\n      });\n\n      preTo(async () =\u003e {\n        await wait(140);\n\n        a = 4;\n      });\n\n      to('a5', (resolve, reject) =\u003e {\n        const error: any = new Error();\n\n        // Added expected and expression message\n        error.name = 'An Error';\n        error.expected = 4;\n        error.expression = 'to be 🍊';\n\n        reject(error);\n      });\n\n    });\n\n    to('a6', async () =\u003e {\n      await wait(74);\n\n      assert(4).eq(4);\n    });\n\n    to('a7', async () =\u003e {\n      assert(['padding-left', 'padding', 'padding-right']).eql(['padding', 'padding-left', 'padding-right']);\n    });\n\n    to('a8', async resolve =\u003e {\n      await wait(4);\n\n      resolve();\n\n      await wait(140);\n\n      assert(4).eq(4);\n    });\n\n    to('a9', async () =\u003e {\n      await assert(function a() { }).throwAsync(4);\n    });\n\n    to('a10', async () =\u003e {\n      assert({\n        \"direction\": \"ltr\",\n        \"preference\": {\n          \"background\": {\n            \"default\": \"neutral\"\n          },\n          \"text\": {\n            \"default\": \"neutral\"\n          },\n          \"visual_contrast\": {\n            \"default\": \"regular\"\n          }\n        },\n        \"mode\": \"regular\",\n        \"palette\": {\n          \"accessibility\": \"regular\",\n          \"visual_contrast\": {\n            \"low\": {\n              \"opacity\": {\n                \"primary\": 0.77,\n                \"secondary\": 0.54,\n                \"tertiary\": 0.27\n              }\n            }\n          }\n        }\n      }).eql({\n        \"direction\": \"ltl\",\n        \"preference\": {\n          \"background\": {\n            \"default\": \"neutral\"\n          },\n          \"text\": {\n            \"default\": \"neutral\"\n          },\n          \"visual_contrast\": {\n            \"default\": \"regular\"\n          }\n        },\n        \"mode\": \"regular\",\n        \"palette\": {\n          \"accessibility\": \"regular\",\n          \"visual_contrast\": {\n            \"low\": {\n              \"opacity\": {\n                \"primary\": 0.77,\n                \"secondary\": 0.54,\n                \"tertiary\": 0.27\n              }\n            }\n          }\n        }\n      });\n    });\n\n    to('a11', async () =\u003e {\n      const value = [\n        'OnesyError',\n        'OnesyError',\n        'OnesyAwsError',\n        'OnesyTestError',\n        'OnesyAmqpError',\n        'AuthenticationError',\n        'AuthorizationError',\n        'AssertError',\n        'ValidationError',\n        'PermissionError',\n        'OnesyMongoError',\n        'ConnectionError',\n        'NotFoundError',\n        'DeveloperError',\n        'OnesyError',\n      ];\n      const value1 = [\n        'OnesyError',\n        'OnesyError',\n        'OnesyAwsError',\n        'OnesyTestError',\n        'OnesyAmqpError',\n        'AuthenticationError',\n        'AuthorizationError',\n        'ValidationError',\n        'PermissionError',\n        'OnesyMongoError',\n        'ConnectionError',\n        'NotFoundError',\n        'DeveloperError',\n        'OnesyError',\n      ];\n\n      assert(value).eql(value1);\n    });\n\n    to('a12', async () =\u003e {\n      const value = {\n        a: {\n          a: {\n            a: {\n              ab: 4,\n            },\n          },\n          ab: 4,\n        },\n      };\n      const value1 = {\n        a: {\n          a: {\n            b: 4,\n            a: {\n              ab: 5,\n              ac: 4,\n            },\n          },\n        },\n        ab: [1, 2, 3, 4],\n      };\n\n      assert(value).eql(value1);\n    });\n\n    to('a13', async () =\u003e {\n      assert(4).eq(4);\n    });\n\n    post(async () =\u003e {\n      await wait(40);\n    });\n\n  });\n\n  to('a14', async () =\u003e {\n    assert(timezones).eql([{ a: [function a() { }, { a: 4 }, 4] }]);\n  });\n\n  await onesyTest.run();\n```\n\nResults logged in nodejs and browser (and with an option for HTML logs)\n\n![OnesyTest results](utils/images/test-results.jpg)\n\n### Dev\n\nInstall\n\n```sh\nyarn\n```\n\nTest\n\n```sh\nyarn test\n```\n\n### Prod\n\nBuild\n\n```sh\nyarn build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Ftest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesy-me%2Ftest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesy-me%2Ftest/lists"}