Skip to content

Commit

Permalink
Removed any-beautify. Changed to official js-beautify package.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkf committed Mar 21, 2013
1 parent 93ea61d commit e41dd0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/beautifiers/js-beautify.js
@@ -1,4 +1,4 @@
var beautify = require('any-beautify');
var beautify = require('js-beautify');
exports = module.exports = function jsBeautify(stream, options, cb) {
var code = "";
stream.on('data', function (d) {
Expand All @@ -7,7 +7,7 @@ exports = module.exports = function jsBeautify(stream, options, cb) {

stream.on('end', function () {
try {
code = beautify.js(code);
code = beautify.js_beautify(code);
} catch (e) {
cb(e);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
"uglify-js": "~2.2",
"yuicompressor": "~2.4",
"closure-compiler": "~0.2",
"any-beautify": "~0.8",
"js-beautify": "~0.4",
"optimist": "~0.3"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions test/beautifiers/js-beautify.js
Expand Up @@ -2,7 +2,7 @@ var expect = require('expect.js'),
sinon = require('sinon'),
fs = require('fs'),
minify = require('../../'),
beautify = require('any-beautify');
beautify = require('js-beautify');

function fixture(name) {
var path = __dirname + "/../fixtures/" + name;
Expand All @@ -12,16 +12,16 @@ function fixture(name) {
describe("MinifyJS", function () {
describe("`js-beautify` beautifier", function () {
it("should return the code", function (done) {
sinon.spy(beautify, 'js');
sinon.spy(beautify, 'js_beautify');
minify.beautify(fixture("valid.js"), {
engine: 'js-beautify'
}, function (err, data) {
if (err)
throw err;

expect(data).to.be.a('string');
expect(beautify.js.called).to.be(true);
beautify.js.restore();
expect(beautify.js_beautify.called).to.be(true);
beautify.js_beautify.restore();
done();
})
});
Expand Down

0 comments on commit e41dd0e

Please sign in to comment.