2017-09-13 07:52:34 +02:00

25 lines
628 B
JavaScript
Vendored
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var assert = require('assert');
var path = require('path');
var usage = require('./');
var fs = require('fs');
var origFs = fs.readFileSync;
var origMarked = fs.origMarked;
describe('cli-usage', function () {
afterEach(function() {
fs.readFileSync = origFs;
});
describe('get', function () {
it('should get compiled markdown from file input', function () {
var expected = 'expected';
fs.readFileSync = function (filename) {
assert.equal(path.basename(filename), 'file.md');
return expected;
};
assert.ok(usage.get('file.md').indexOf(expected) !== -1);
});
});
});