Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for existing functionality #9

Merged
merged 20 commits into from
May 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
temp/
test/temp/
14 changes: 8 additions & 6 deletions demo_frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ module.exports = function(node){
var dataForHtml = node.querySelector("[data-for=html] > pre");
dataForHtml.innerHTML = prettyify(html);

var dataForJS = node.querySelector("[data-for=js] > pre");
dataForJS.innerHTML = prettyify(js.replace(/\t/g," "));
show(node.querySelector("[data-tab=js]"));
if (js) {
var dataForJS = node.querySelector("[data-for=js] > pre");
dataForJS.innerHTML = prettyify(js.replace(/\t/g," "));
show(node.querySelector("[data-tab=js]"));
}

tabs();
}
Expand Down Expand Up @@ -86,11 +88,11 @@ module.exports = function(node){
}
}
}
return source.trim();
return (source ? source.trim() : '');
}

function show(el) {
el.style.display = "block";
el.style.display = "";
}

function hide(el) {
Expand All @@ -101,7 +103,7 @@ module.exports = function(node){
node.querySelector("ul").addEventListener("click", function(ev){
var el = ev.target;
if(el.className === "tab") {
toggle(el.dataset.tab);
toggle(el.dataset ? el.dataset.tab : el.getAttribute("data-tab"));
}
});
toggle("demo");
Expand Down
53 changes: 29 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,42 @@
"name": "bit-docs-tag-demo",
"version": "0.3.0",
"description": "@demo tag for bit-docs",
"main": "demo.js",
"scripts": {
"test": "mocha test.js --reporter spec",
"postversion": "git push --tags && git push",
"preversion": "npm test",
"release:pre": "npm version prerelease && npm publish",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/bit-docs/bit-docs-tag-demo.git"
},
"keywords": [
"bit-docs"
],
"author": "Bitovi",
"license": "MIT",
"homepage": "https://github.com/bit-docs/bit-docs-tag-demo#readme",
"bugs": {
"url": "https://github.com/bit-docs/bit-docs-tag-demo/issues"
},
"homepage": "https://github.com/bit-docs/bit-docs-tag-demo#readme",
"dependencies": {
"bit-docs-process-tags": "^0.0.3",
"bit-docs-type-annotate": "^0.0.1"
"license": "MIT",
"author": "Bitovi",
"main": "demo.js",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/bit-docs/bit-docs-tag-demo.git"
},
"scripts": {
"release:major": "npm version major && npm publish",
"release:minor": "npm version minor && npm publish",
"release:patch": "npm version patch && npm publish",
"release:pre": "npm version prerelease && npm publish",
"test": "mocha test.js --reporter spec",
"preversion": "npm test",
"postversion": "git push --tags && git push"
},
"devDependencies": {
"bit-docs-generate-html": "^0.2.0",
"connect": "^2.14.4",
"mocha": "^2.5.3",
"zombie": "^4.2.1"
"bit-docs-generate-html": "0.5.0-pre.4",
"can-stache": "3.0.20",
"express": "^4.15.2",
"mocha": "^3.2.0",
"rimraf": "^2.6.1",
"steal": "^1.4.6",
"steal-less": "^1.2.0",
"zombie": "^5.0.5"
},
"steal": {
"plugins": [
"steal-less"
]
}
}
Loading