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

NodeJS support - npm package - tests #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
html
php
test
node_modules
change.log
jquery*.js
main.js
*.html
*.css
*.iml
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- 0.6
- 0.8
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./vkbeautify.js");
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "vkbeautify",
"version": "0.99.0",
"author": "Vadim Kiryukhin <[email protected]>",
"description": "javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats",
"repository": {
"type": "git",
"url": "git://github.com/rappid/rAppid.js.git"
},
"keywords": [
"vkbeautify", "pretty", "print"
],
"devDependencies": {
"mocha": "latest",
"chai": "latest"
},
"license": "MIT",
"homepage": "http://www.eslinstructor.net/vkbeautify/"
}
35 changes: 35 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var vkbeautify = require(".."),
expect = require('chai').expect;

describe('vkbeautify', function () {

it("should export the library", function () {
expect(vkbeautify).to.exist;
expect(vkbeautify.VkBeautify).to.be.an.instanceof(Function);
expect(vkbeautify.vkbeautify).to.be.an.instanceof(vkbeautify.VkBeautify);
});


describe('xml', function () {

it("root tag", function () {

var input = "<foo />",
output = vkbeautify.vkbeautify.xml(input);

expect(output).to.eql("<foo />");

});

it("should indent xml", function () {

var input = "<foo><bar/></foo>",
output = vkbeautify.vkbeautify.xml(input);

expect(output).to.eql("<foo>\n <bar/>\n</foo>");

});

});

});
Loading