gulp-xunit-runner
A gulp.js plugin to facilitate running XUnit tests on .NET assemblies. Much of this work was inspired by the gulp-nunit-runner plugin.
Installation
From the root of your project (where your gulpfile.js
is), issue the following command:
npm install --save-dev gulp-xunit-runner
Usage
The plugin uses standard gulp.src
globs to retrieve a list of assemblies that should be tested with XUnit. By default the plugin looks for the XUnit console runner in your PATH
. You can optionally specify the XUnit bin
folder or the full path of the runner as demonstrated below. You should add {read: false}
to your gulp.src
so that it doesn't actually read the files and only grabs the file names.
var gulp = xunit = ; gulp;
This would result in the following command being executed (assuming you had Database and Services Test assemblies.)
C:/xunit/bin/xunit-console.exe "C:\full\path\to\Database.Test.dll" "C:\full\path\to\Services.Test.dll"
Note: If you use Windows paths with \
's, you need to escape them with another \
. (e.g. C:\\xunit\\bin\\xunit-console.exe
). However, you may also use forward slashes /
instead which don't have to be escaped.
You may also add options that will be used as XUnit command line switches. Any property that is a boolean true
will simply be added to the command line, String values will be added to the switch parameter separated by a colon and arrays will be a comma seperated list of values.
For more information on available switches, see the XUnit documentation:
http://xunit.github.io/#documentation
var gulp = xunit = ; gulp;
This would result in the following command:
C:/xunit/bin/xunit-console.exe /nologo /config:"Release" /transform:"myTransform.xslt" "C:\full\path\to\Database.Test.dll" "C:\full\path\to\Services.Test.dll"
Options
Below are all avialable options.
;
Release Notes
0.1.0 (02 March 2015)
- Initial release