Skip to content

Commit

Permalink
fix gulp babili options for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam committed Mar 3, 2017
1 parent 9663c12 commit 849d44d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`gulp-babili comments should remove all comments when false 1`] = `"foo(),bar(),baz();"`;
exports[`gulp-babili comments should remove all comments when false 1`] = `"function foo(){}bar();var a=baz();"`;

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

exports[`gulp-babili comments should take a custom function 1`] = `"/* YAC - yet another comment */foo(),bar(),baz();"`;
exports[`gulp-babili comments should take a custom function 1`] = `"function foo(){}bar();/* YAC - yet another comment */var a=baz();"`;
12 changes: 6 additions & 6 deletions packages/gulp-babili/__tests__/gulp-babili-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ describe("gulp-babili", () => {
* @license
* This is a test
*/
foo();
function foo(){}
// this is another comment
bar();
/* YAC - yet another comment */
baz();
var a = baz();
`);

let file;
Expand All @@ -122,7 +122,7 @@ describe("gulp-babili", () => {
});
});

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

it("should remove all comments when false", () => {
return new Promise((resolve, reject) => {
const stream = gulpBabili({
const stream = gulpBabili({}, {
comments: false
});
stream.on("data", () => {
Expand All @@ -148,9 +148,9 @@ describe("gulp-babili", () => {
});
});

xit("should take a custom function", () => {
it("should take a custom function", () => {
return new Promise((resolve, reject) => {
const stream = gulpBabili({
const stream = gulpBabili({}, {
comments(contents) {
return contents.indexOf("YAC") !== -1;
}
Expand Down

0 comments on commit 849d44d

Please sign in to comment.