{"id":17983184,"url":"https://github.com/kassio/vmtest","last_synced_at":"2026-05-01T14:33:09.757Z","repository":{"id":139148788,"uuid":"257579417","full_name":"kassio/vmtest","owner":"kassio","description":"Vim Minimal Test framework","archived":false,"fork":false,"pushed_at":"2020-07-28T12:36:14.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T02:12:28.034Z","etag":null,"topics":["neovim","neovim-plugin","vim","vim-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Vim script","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/kassio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":["kassio"]}},"created_at":"2020-04-21T11:53:17.000Z","updated_at":"2024-07-01T07:26:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6f13053-9c0e-4dce-b2ee-845b6a9c8f99","html_url":"https://github.com/kassio/vmtest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kassio/vmtest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassio%2Fvmtest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassio%2Fvmtest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassio%2Fvmtest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassio%2Fvmtest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kassio","download_url":"https://codeload.github.com/kassio/vmtest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassio%2Fvmtest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32501399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["neovim","neovim-plugin","vim","vim-plugin"],"created_at":"2024-10-29T18:16:23.238Z","updated_at":"2026-05-01T14:33:09.726Z","avatar_url":"https://github.com/kassio.png","language":"Vim script","funding_links":["https://github.com/sponsors/kassio"],"categories":[],"sub_categories":[],"readme":"# VMTest - Vim Minimal Test framework\n\n:warning: beta version :warning:\n\n[![lint](https://github.com/kassio/vmtest/workflows/lint/badge.svg?branch=master)](https://github.com/kassio/vmtest/actions?query=workflow%3Alint)\n[![example](https://github.com/kassio/vmtest/workflows/example/badge.svg?branch=master)](https://github.com/kassio/vmtest/actions)\n\nThe main goal of this plugin is to give a _minimal structure_ to write vimscript\ntests based on the existing `assert_*` functions that already exist.\n\n* _minimal structure_: use basic vimscript data structures and functions.\n\n## Structure\n\nVMTest simple iterate over `g:vmtests` keys looking for functions to run and\nprint `Success` or `Failed` based on `v:errors`.\n\nThere are a few reserved keys, used internally:\n* `_name` - Optional custom name of a scope\n* `_before` - Call back to run before each test of the scope\n* `_after` - Call back to run after each test of the scope\n* `_tests_counter` - Count of tests that failed\n\n### Example\n\nOn your plugin you create a `vmtest` folder with a test file like:\n\n* tests\n\n```viml\n\" Setup the vmtest for the given plugin\ncall vmtest#plugin('vmtest')\n\n\" Scope without a custom name\n\" The scope key will be used as its name\nlet g:vmtests.vmtest.first_scope = {}\n\n\" Similar to the `setup` of some test libraries\nfunction! g:vmtests.vmtest.first_scope._before()\n  echo \"callback to run before each test\\n\"\n  let self.context_var = 'foo'\nendfunction\n\n\" Similar to the `teardown` of some test libraries\nfunction! g:vmtests.vmtest.first_scope._after()\n  echo \"callback to run after each test\\n\"\nendfunction\n\n\" A test function on the `first_scope` scope\nfunction! g:vmtests.vmtest.first_scope.test_foo()\n  call assert_equal(self.context_var, 2)\nendfunction\n\n\" A test function on the `first_scope` scope\nfunction! g:vmtests.vmtest.first_scope.test_bar()\n  call assert_notequal(self.context_var, 2)\nendfunction\n\n\" Scope with a custom name\nlet g:vmtests.vmtest.second_scope = { '_name': 'My Other Scope' }\n\n\" A test function on the `second_scope` scope\nfunction! g:vmtests.vmtest.second_scope.test_bar()\n  call assert_equal(1, 1)\nendfunction\n```\n\n* output\n\n```text\n=\u003e vmtest\n -\u003e first_scope\ncallback to run before each test\n  » test_bar: Success\ncallback to run after each test\ncallback to run before each test\n  » test_foo: Failed\n  ! Expected 'foo' but got 2\ncallback to run after each test\n -\u003e second_scope\n  » test_bar: Success\n\n\n=\u003e 3 Tests Runned.\n=\u003e 2 Tests Succeed, 1 Tests Failed.\n```\n\n# Contribution\n\n:warning: beta version :warning:\n\nFeedback and Pull Requests are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassio%2Fvmtest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkassio%2Fvmtest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassio%2Fvmtest/lists"}