{"id":16359705,"url":"https://github.com/jmsv/xunit-to-nunit","last_synced_at":"2026-04-30T13:34:39.660Z","repository":{"id":57402455,"uuid":"94532817","full_name":"jmsv/xunit-to-nunit","owner":"jmsv","description":"Converts C# XUnit tests to NUnit tests","archived":false,"fork":false,"pushed_at":"2022-11-01T00:27:03.000Z","size":164,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T12:38:39.538Z","etag":null,"topics":["c-sharp","converter","dotnet","hacktoberfest","nunit","parser","unit-testing","xunit"],"latest_commit_sha":null,"homepage":"https://jmsv.github.io/xunit-to-nunit","language":"C#","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/jmsv.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":"2017-06-16T10:18:58.000Z","updated_at":"2023-03-05T08:46:01.000Z","dependencies_parsed_at":"2022-09-17T06:50:52.253Z","dependency_job_id":null,"html_url":"https://github.com/jmsv/xunit-to-nunit","commit_stats":null,"previous_names":["jamesevickery/xunit-to-nunit"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jmsv/xunit-to-nunit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fxunit-to-nunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fxunit-to-nunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fxunit-to-nunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fxunit-to-nunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmsv","download_url":"https://codeload.github.com/jmsv/xunit-to-nunit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsv%2Fxunit-to-nunit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"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":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"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":["c-sharp","converter","dotnet","hacktoberfest","nunit","parser","unit-testing","xunit"],"created_at":"2024-10-11T02:09:27.577Z","updated_at":"2026-04-30T13:34:39.636Z","avatar_url":"https://github.com/jmsv.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xunit-to-nunit\n\n[![npm version](https://badge.fury.io/js/xunit-to-nunit.svg)](https://badge.fury.io/js/xunit-to-nunit)\n[![Build Status](https://travis-ci.org/jmsv/xunit-to-nunit.svg?branch=master)](https://travis-ci.org/jmsv/xunit-to-nunit)\n[![Dependencies](https://www.versioneye.com/user/projects/59819587368b080078e5cabc/badge.svg)](https://www.versioneye.com/user/projects/59819587368b080078e5cabc?child=summary)\n\n[![NPM](https://nodei.co/npm/xunit-to-nunit.png)](https://nodei.co/npm/xunit-to-nunit/)\n\nConverts C# XUnit tests to NUnit tests.\n\n_Disclaimer: Far from perfect - something I used as a quick hack to convert loads of large tests_\n\n## Links\n\n- Converter app: [jmsv.github.io/xunit-to-nunit](https://jmsv.github.io/xunit-to-nunit)\n- Node module: [npmjs.com/package/xunit-to-nunit](https://www.npmjs.com/package/xunit-to-nunit)\n\n## :package: Installation\n\n```bash\nnpm install xunit-to-nunit\n```\n\n## Usage\n\n### Require\n\n```javascript\nvar x2n = require('xunit-to-nunit')\n```\n\n### Convert test from string\n\n```javascript\nvar nunitTest = x2n.convertCode(xunitTest)\n```\n\n### Convert test from file\n\n```javascript\nx2n.convertFile('xunit-source-path.cs', 'nunit-destination-path.cs')\n```\n\n### Convert tests from directory\n\n```javascript\nx2n.convertFiles('xunit/source/directory', 'nunit/destination/directory')\n```\n\nThis function calls `convertFile` for all files in the source directory.\n\n#### Options\n\n`convertFiles` has a third (optional) parameter: `options`. This should be a dictionary value, containing all or any of the following  parameters:\n\n##### :wrench: recursive (default: `false`)\n\nSet to `true`, this parameter will convert tests in all subdirectories including those at the source root. Directory structure is maintained at the conversion destination.\n\n##### :wrench: verbose (default: `true`)\n\nWhen `true`, the module logs an info message to the terminal when a file is converted. When a file conversion fails, a error log message is displayed regardless of the value of `verbose`.\n\nFor example,\n\n```javascript\nvar options = {\n  recursive: true,\n  verbose: false\n}\n\nx2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)\n```\n\n#### Writing converted tests to source directory\n\nWhen _source = destination_, '`_NUnit`' is appended to the filename. For example, where _destination = `dir`_, `dir/SomeTests.cs` is converted and the result is written to `dir/SomeTests_NUnit.cs`.\n\nThis behaviour can be changed with the following parameters:\n\n##### :wrench: append (default: `'_NUnit'`)\n\nString to be appended to filenames when writing destination files to the source directory.\n\n##### :wrench: overwrite (default: `false`)\n\nIf _`overwrite` = true_, `append` is ignored, and source files are overwritten at destination.\n\nFor example,\n\n```javascript\n// Append destination filenames with `append` text\nvar options = {\n  append: '_Test',\n  overwrite: false // `overwrite` is false by default\n}\n\n// or, overwrite source files\nvar options = {\n  overwrite: true\n}\n\nx2n.convertFiles('xunit/source/directory', 'nunit/destination/directory', options)\n\n```\n\n## Contributing\n\nFeel free to add things / suggest things to be added by either [opening an issue](https://github.com/jmsv/xunit-to-nunit/issues) or by submitting a pull request.\n\n## References\n\n- https://xunit.github.io/docs/comparisons.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsv%2Fxunit-to-nunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmsv%2Fxunit-to-nunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsv%2Fxunit-to-nunit/lists"}