Skip to content

Commit

Permalink
Disable the comments tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boopathi committed Feb 13, 2017
1 parent 62e06fd commit feed6a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
18 changes: 1 addition & 17 deletions packages/babel-preset-babili/src/index.js
Expand Up @@ -105,28 +105,12 @@ function preset(context, _opts = {}) {

const plugins = generate(optionsTree, opts);

// comments
let comments = /@preserve|@licen(s|c)e/;
if (Object.prototype.hasOwnProperty.call(opts, "comments")) {
comments = opts.comments;
}

return {
minified: true,
shouldPrintComment(contents) {
return _shouldPrintComment(contents, comments);
},
comments: false,
presets: [
{ plugins }
],
passPerPreset: true,
};
}

function _shouldPrintComment(contents, predicate) {
switch (typeof predicate) {
case "function": return predicate(contents);
case "object": return predicate.test(contents);
default: return !!predicate;
}
}
@@ -1,5 +1,9 @@
exports[`gulp-babili comments should remove all comments when false 1`] = `"foo(),bar(),baz();"`;

exports[`gulp-babili comments should remove comments by default except license and preserve 1`] = `"foo(),bar(),baz();"`;
exports[`gulp-babili comments should remove comments by default except license and preserve 1`] = `"
/**
* @license
* This is a test
*/foo(),bar(),baz();"`;

exports[`gulp-babili comments should take a custom function 1`] = `"foo(),bar(),baz();"`;
exports[`gulp-babili comments should take a custom function 1`] = `"/* YAC - yet another comment */foo(),bar(),baz();"`;
4 changes: 2 additions & 2 deletions packages/gulp-babili/__tests__/gulp-babili-test.js
Expand Up @@ -122,7 +122,7 @@ describe("gulp-babili", () => {
});
});

it("should remove comments by default except license and preserve", () => {
xit("should remove comments by default except license and preserve", () => {
return new Promise((resolve, reject) => {
const stream = gulpBabili();
stream.on("data", function (file) {
Expand All @@ -148,7 +148,7 @@ describe("gulp-babili", () => {
});
});

it("should take a custom function", () => {
xit("should take a custom function", () => {
return new Promise((resolve, reject) => {
const stream = gulpBabili({
comments(contents) {
Expand Down
1 change: 0 additions & 1 deletion packages/gulp-babili/src/index.js
Expand Up @@ -30,7 +30,6 @@ function gulpBabili(babiliOpts = {}, {

const babelOpts = {
minified: true,
compact: true,
babelrc: false,
ast: false,

Expand Down

0 comments on commit feed6a5

Please sign in to comment.