(msg, inputFile, expectedCode, args)
| 149 | } |
| 150 | |
| 151 | function exitCode (msg, inputFile, expectedCode, args) { |
| 152 | args = args || []; |
| 153 | test(msg, function (t) { |
| 154 | t.plan(1); |
| 155 | t.timeoutAfter(4000); |
| 156 | |
| 157 | var entry = [ path.resolve(__dirname, 'fixtures', inputFile) ]; |
| 158 | var proc = spawn(cmd, entry.concat(args)); |
| 159 | proc.on('close', function (code) { |
| 160 | t.equal(code, expectedCode, 'matches exit code'); |
| 161 | }); |
| 162 | }); |
| 163 | } |