From 8fe3a96b337baf39f8bfe15da6ed85fcfb594bc0 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Tue, 19 Jul 2016 17:19:05 +0200 Subject: [PATCH] Check in Jusfox skeleton --- README.md | 2 ++ index.js | 9 +++++++++ package.json | 16 ++++++++++++++++ test/test-index.js | 19 +++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json create mode 100644 test/test-index.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..2481d2a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +#Jusfox +Legislative text finder diff --git a/index.js b/index.js new file mode 100644 index 0000000..6995d96 --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +var self = require("sdk/self"); + +// a dummy function, to show how tests work. +// to see how to test this function, look at test/test-index.js +function dummy(text, callback) { + callback(text); +} + +exports.dummy = dummy; diff --git a/package.json b/package.json new file mode 100644 index 0000000..c4266fb --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "title": "Jusfox", + "name": "jusfox", + "version": "0.0.1", + "description": "Legislative text finder", + "main": "index.js", + "author": "Klaus-Uwe Mitterer", + "engines": { + "firefox": ">=38.0a1", + "fennec": ">=38.0a1" + }, + "license": "Kumi License", + "keywords": [ + "jetpack" + ] +} diff --git a/test/test-index.js b/test/test-index.js new file mode 100644 index 0000000..b3ad6e8 --- /dev/null +++ b/test/test-index.js @@ -0,0 +1,19 @@ +var main = require("../"); + +exports["test main"] = function(assert) { + assert.pass("Unit test running!"); +}; + +exports["test main async"] = function(assert, done) { + assert.pass("async Unit test running!"); + done(); +}; + +exports["test dummy"] = function(assert, done) { + main.dummy("foo", function(text) { + assert.ok((text === "foo"), "Is the text actually 'foo'"); + done(); + }); +}; + +require("sdk/test").run(exports);