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(-2319);
		};

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

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();
	});
});

Test still fails - but because of a timeout
Test still fails - but because of a timeout

The asynchronous file test still fails. Now it fails because the Mocha
believes the test takes longer than (the default) 2000 ms.

The previous commit passed in the test parameter, `done`. The
consequence of this change means that the code now waits for the
callback function, to be executed. We have now changed the expected
value to 15 (which is correct now); however, because the test code
**does not** call the `done` callback, Mocha reports a timeout error.
