{"id":15489583,"url":"https://github.com/pablopunk/myass","last_synced_at":"2025-03-28T16:17:59.315Z","repository":{"id":57306450,"uuid":"156627786","full_name":"pablopunk/myass","owner":"pablopunk","description":"MY ASSertion framework. Magic free. 0 Dependencies","archived":false,"fork":false,"pushed_at":"2020-10-12T01:16:15.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T18:47:13.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pablopunk.com/myass","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/pablopunk.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}},"created_at":"2018-11-08T00:41:43.000Z","updated_at":"2020-10-12T01:16:17.000Z","dependencies_parsed_at":"2022-09-20T22:11:55.014Z","dependency_job_id":null,"html_url":"https://github.com/pablopunk/myass","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fmyass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fmyass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fmyass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablopunk%2Fmyass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pablopunk","download_url":"https://codeload.github.com/pablopunk/myass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246059337,"owners_count":20717085,"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-02T07:06:32.488Z","updated_at":"2025-03-28T16:17:59.292Z","avatar_url":"https://github.com/pablopunk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# myass\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/pablopunk/myass\"\u003e\u003cimg src=\"https://img.shields.io/travis/pablopunk/myass.svg\" /\u003e \u003c/a\u003e\n  \u003ca href=\"https://packagephobia.now.sh/result?p=myass\"\u003e\u003cimg src=\"https://packagephobia.now.sh/badge?p=myass\" alt=\"Install size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\" alt=\"Prettier code\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/pablopunk/miny\"\u003e\u003cimg src=\"https://img.shields.io/badge/made_with-miny-1eced8.svg\" /\u003e \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/myass\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/myass.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eMY ASSertion framework. Magic free. 0 Dependencies.\u003c/i\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://file-vggefwrhbk.now.sh\" alt=\"screenshot\"\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n- [How to install](#install)\n- [Features](#features)\n- [Usage](#usage)\n- [API](#api)\n\n\u003chr\u003e\n\n## Install\n\n```bash\nnpm install myass\n```\n\n## Features\n\n- Asynchronous\n- Incredibly lightweight\n- 0 dependencies\n- No fancy features, focus on assertions\n- Simple and beautiful output\n- Fail fast\n\n## Usage\n\nYou can use all the methods that the native `assert` has ([see docs](https://nodejs.org/api/assert.html)) but there are some [additional functions](#api) available.\n\nCreate one of this entry points for your tests:\n\n- `test.js`\n- `tests.js`\n- `test/index.js`\n- `tests/index.js`\n\n```js\nconst test = require('myass')\n\ntest('True is equals to true', async (t) =\u003e {\n  t.is(true, true)\n})\n\ntest('True is never equal to false', async (t) =\u003e {\n  t.notEqual(true, false)\n})\n\ntest('Objects are equal even tho properties are shuffled', async (t) =\u003e {\n  t.is({ foo: 'bar', bar: 'foo' }, { bar: 'foo', foo: 'bar' })\n})\n\ntest('This one throws', async (t) =\u003e {\n  t.throws(() =\u003e t.is(1, 1))\n})\n\ntest('This will throw too', async (t) =\u003e {\n  t.throws(() =\u003e {\n    throw new Error()\n  })\n})\n```\n\n`myass` is also a cli, so you can just call it like this:\n\n```json\n\"scripts\": {\n  \"test\": \"myass\"\n}\n```\n\nAnother cool feature is that `myass` runs tests like a script, so you\ncan execute the file directly `node test.js` and it would still work.\n\n## API\n\n\u003e If you use **typescript**, `myass` has typings!\n\nThe module is a function that takes a name and a test function:\n\n```js\nmyass(name, (t) =\u003e {})\n```\n\n\u003e name: string\n\nThis argument is the name of the test you are about to provide. It will be shown in the output whenever that test fails or succeeds.\n\n\u003e t: object\n\nI named it `t` but you can use whatever name you want for this argument. It contains all the necessary functions to run your assertions. As mentioned, you can use all the available functions in node's `assert` module. _myass_ also provides some helpers that makes it easier to code:\n\n### `t.is(value, expected)`\n\nShortcut for [`deepStrictEqual`](https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message).\n\n```js\ntest('Objects are equal', async (t) =\u003e {\n  t.is({ foo: 'bar' }, { foo: 'bar' }) // passes\n})\n```\n\n### `t.true(value)` or `t.false(value)`\n\nPasses if `value` is `true` or `false`. Notice that **it has to be true**, not _truthy_.\n\n```js\ntest('True is true', async (t) =\u003e {\n  t.true(true) // passes\n})\ntest('False is false', async (t) =\u003e {\n  t.false(false) // passes\n})\n```\n\n### `t.regex(value, regex)` or `t.regex(regex, value)`\n\nChecks if given `value` matches the given `regex`.\n\n```js\ntest('Matches regex', async (t) =\u003e {\n  t.regex('abcdef', /abcdef/) // passes\n  t.regex(new RegExp('foo'), 'bar') // won't pass\n})\n```\n\nThere's also `t.notRegex` to test a string NOT to match a regular expression.\n\n## License\n\nMIT\n\n## Author\n\n| ![me](https://gravatar.com/avatar/fa50aeff0ddd6e63273a068b04353d9d?size=100) |\n| ---------------------------------------------------------------------------- |\n| [Pablo Varela](https://pablopunk.com)                                        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablopunk%2Fmyass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablopunk%2Fmyass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablopunk%2Fmyass/lists"}