UNPKG

3.85 kBMarkdownView Raw
1# grunt-nunit-runner [![Build Status](https://api.travis-ci.org/mikeobrien/grunt-nunit-runner.png?branch=master)](https://travis-ci.org/mikeobrien/grunt-nunit-runner) [![NPM version](https://badge.fury.io/js/grunt-nunit-runner.png)](https://npmjs.org/package/grunt-nunit-runner)
2Grunt plugin for running [NUnit](http://www.nunit.org/).
3NOTE: this plugin requires Grunt 0.4.x.
4
5## Getting Started
6From the same directory as your project's Gruntfile and package.json, install
7this plugin with the following command:
8
9```bash
10$ npm install grunt-nunit-runner --save-dev
11```
12
13Next add this line to your project's Gruntfile:
14
15```js
16grunt.loadNpmTasks('grunt-nunit-runner');
17```
18
19## Config
20Inside your `Gruntfile.js` file, add a section named `nunit`, containing
21assembly information:
22
23```js
24nunit: {
25 options: {
26
27 // The path to the NUnit bin folder. If not specified the bin
28 // folder must be in the system path.
29 path: 'c:\\Program Files\\NUnit\\bin',
30
31 // Runs the anycpu or x86 build of NUnit. Default is anycpu.
32 // http://www.nunit.org/index.php?p=nunit-console&r=2.6.3
33 platform: 'anycpu|x86',
34
35 // Can be solutions, projects or individual assemblies. Solutions
36 // are searched for projects referencing nunit.framework.dll.
37 files: ['src/MySolution.sln',
38 'src/Tests/Tests.csproj',
39 'src/Tests/bin/Debug/Tests.dll'],
40
41 // The options below map directly to the NUnit console runner. See here
42 // for more info: http://www.nunit.org/index.php?p=consoleCommandLine&r=2.6.3
43
44 // Name of the test case(s), fixture(s) or namespace(s) to run.
45 run: ['TestSuite.Unit', 'TestSuite.Integration'],
46
47 // Name of a file containing a list of the tests to run, one per line.
48 runlist: 'TestsToRun.txt',
49
50 // Project configuration (e.g.: Debug) to load.
51 config: 'Debug',
52
53 // Name of XML result file (Default: TestResult.xml)
54 result: 'TestResult.xml',
55
56 // Suppress XML result output.
57 noresult: true|false,
58
59 // File to receive test output.
60 output: 'TestOutput.txt',
61
62 // File to receive test error output.
63 err: 'TestErrors.txt',
64
65 // Work directory for output files.
66 work: 'BuildArtifacts',
67
68 // Label each test in stdOut.
69 labels: true|false,
70
71 // Set internal trace level.
72 trace: 'Off|Error|Warning|Info|Verbose',
73
74 // List of categories to include.
75 include: ['BaseLine', 'Unit'],
76
77 // List of categories to exclude.
78 exclude: ['Database', 'Network'],
79
80 // Framework version to be used for tests.
81 framework: 'net-1.1',
82
83 // Process model for tests.
84 process: 'Single|Separate|Multiple',
85
86 // AppDomain Usage for tests.
87 domain: 'None|Single|Multiple',
88
89 // Apartment for running tests (Default is MTA).
90 apartment: 'MTA|STA',
91
92 // Disable shadow copy when running in separate domain.
93 noshadow: true|false,
94
95 // Disable use of a separate thread for tests.
96 nothread: true|false,
97
98 // Base path to be used when loading the assemblies.
99 basepath: 'src',
100
101 // Additional directories to be probed when loading assemblies.
102 privatebinpath: ['lib', 'bin'],
103
104 // Set timeout for each test case in milliseconds.
105 timeout: 1000,
106
107 // Wait for input before closing console window.
108 wait: true|false,
109
110 // Do not display the logo.
111 nologo: true|false,
112
113 // Do not display progress.
114 nodots: true|false,
115
116 // Stop after the first test failure or error.
117 stoponerror: true|false,
118
119 // Erase any leftover cache files and exit.
120 cleanup: true|false
121
122 }
123}
124```
125
126## License
127MIT License
\No newline at end of file