Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[test dist] Use `assert-called`

  • Loading branch information...
commit 13d969a721e5bca0c8071999a7b97c9693c4a776 1 parent 0f3f7f2
Maciej Małecki authored

Showing 2 changed files with 6 additions and 7 deletions. Show diff stats Hide diff stats

  1. +3 0  package.json
  2. +3 7 test/spawn-command-test.js
3  package.json
@@ -6,5 +6,8 @@
6 6 "main": "./lib/spawn-command",
7 7 "scripts": {
8 8 "test": "node test/spawn-command-test.js"
  9 + },
  10 + "devDependencies": {
  11 + "assert-called": "0.0.x"
9 12 }
10 13 }
10 test/spawn-command-test.js
... ... @@ -1,5 +1,6 @@
1 1 var path = require('path'),
2 2 assert = require('assert'),
  3 + assertCalled = require('assert-called'),
3 4 spawnCommand = require('../');
4 5
5 6 var child = spawnCommand('grep commit < ' + path.join(__dirname, 'fixtures', 'commit')),
@@ -15,13 +16,8 @@ child.stderr.on('data', function (chunk) {
15 16 stderr += chunk;
16 17 });
17 18
18   -child.on('exit', function (exitCode) {
19   - exited = true;
  19 +child.on('exit', assertCalled(function (exitCode) {
20 20 assert.equal(exitCode, 0);
21 21 assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c\n');
22 22 assert.equal(stderr, '');
23   -});
24   -
25   -process.on('exit', function () {
26   - assert(exited);
27   -});
  23 +}));

0 comments on commit 13d969a

Please sign in to comment.
Something went wrong with that request. Please try again.