From 2a3c1f3fdedc63a5af7c24668a23d8e4540b9b0b Mon Sep 17 00:00:00 2001 From: Amanpreet Singh Date: Sun, 26 Apr 2015 12:46:26 +0530 Subject: [PATCH] Add base for tests and util lib --- package.json | 7 ++++--- tests/test.js | 14 ++++++++++++++ tests/utils.js | 12 ++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tests/utils.js diff --git a/package.json b/package.json index 2da995c..e33c642 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,9 @@ }, "bugs": "https://github.com/apsdehal/ctf-tools/issues", "devDependencies": { - "mocha": "~2.2.1", - "marked": "^0.3.3" + "cheerio": "^0.19.0", + "marked": "^0.3.3", + "mocha": "~2.2.1" }, "licenses": [ { @@ -29,5 +30,5 @@ "scripts": { "test": "node test.js" }, - "keywords": [], + "keywords": [] } diff --git a/tests/test.js b/tests/test.js index e69de29..0133590 100644 --- a/tests/test.js +++ b/tests/test.js @@ -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 () { + + }); +}) \ No newline at end of file diff --git a/tests/utils.js b/tests/utils.js new file mode 100644 index 0000000..fdbb651 --- /dev/null +++ b/tests/utils.js @@ -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); + }, + } +})(); \ No newline at end of file