Portfolio/node_modules/cli-usage/tests.js
oitsjustjose 4e066bffc9 Init
2017-02-25 03:50:31 -05:00

24 lines
628 B
JavaScript
Raw 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);
});
});
});