var expect = require('chai').expect;
var linesCount = require('../src/files');

describe('test server-side callback', function() {
	it('should return correct line count for a valid file', function(done) {
		// A nice try, but this implementation will not actually work.
		// The test "works," but since it expects a **negative count**
		// (not exactly plausible).
		var callback = function(count) {
			expect(count).to.be.eql(15);
		};

		linesCount('src/files.js', callback);
		// done();
	});
});

@@ -204,180 +204,220 @@
 %7B%0A%09%09
-// A nice try, but this implementation will not actually work.%0A%09%09// The test %22works,%22 but since it expects a **negative count**%0A%09%09// (not exactly plausible).%0A%09%09var callback
+var callback = function(count) %7B%0A%09%09%09expect(count).to.be.eql(15);%0A%09%09%7D;%0A%0A%09%09linesCount('src/files.js', callback);%0A%09%09done();%0A%09%7D);%0A%0A%09it('should report an error for an invalid file name', function(done) %7B%0A%09%09var onError
  = f
@@ -416,37 +416,37 @@
 rror = function(
-count
+error
 ) %7B%0A%09%09%09expect(co
@@ -435,37 +435,37 @@
 or) %7B%0A%09%09%09expect(
-count
+error
 ).to.be.eql(15);
@@ -464,64 +464,137 @@
 eql(
-15);%0A%09%09%7D;%0A%0A%09%09linesCount('src/files.js', callback
+'unable to open file src/files.js');%0A%09%09%09done();%0A%09%09%7D;%0A%0A%09%09linesCount('src/files.js', function() %7B return undefined; %7D, onError
 );%0A%09%09
-// 
 done

Test verifying async behavior on error