Add base for tests and util lib

This commit is contained in:
Amanpreet Singh 2015-04-26 12:46:26 +05:30
parent c6f61ac4ca
commit 2a3c1f3fde
3 changed files with 30 additions and 3 deletions

View file

@ -14,8 +14,9 @@
}, },
"bugs": "https://github.com/apsdehal/ctf-tools/issues", "bugs": "https://github.com/apsdehal/ctf-tools/issues",
"devDependencies": { "devDependencies": {
"mocha": "~2.2.1", "cheerio": "^0.19.0",
"marked": "^0.3.3" "marked": "^0.3.3",
"mocha": "~2.2.1"
}, },
"licenses": [ "licenses": [
{ {
@ -29,5 +30,5 @@
"scripts": { "scripts": {
"test": "node test.js" "test": "node test.js"
}, },
"keywords": [], "keywords": []
} }

View file

@ -0,0 +1,14 @@
var assert = require('assert')
utils = require('./utils');
var $ = utils.getSelectorObject();
describe('Main module', function () {
it('should contain a link for all title', function () {
});
it('should be sorted alphabetically', function () {
});
})

12
tests/utils.js Normal file
View file

@ -0,0 +1,12 @@
var fs = require('fs'),
marked = require('marked'),
cheerio = require('cheerio');
module.exports = (function () {
return {
getSelectorObject: function () {
var html = marked(fs.readFileSync('../README.md'));
return cheerio.load(html);
},
}
})();