-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Gulp Babili issue #454
Merged
Merged
Gulp Babili issue #454
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
13 changes: 7 additions & 6 deletions
13
packages/gulp-babili/__tests__/__snapshots__/gulp-babili-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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();"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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) { | ||
|
@@ -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", () => { | ||
|
@@ -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({}, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the options miss I was talking about @boopathi |
||
comments(contents) { | ||
return contents.indexOf("YAC") !== -1; | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converting
foo()
tofunction foo() {}
is the weirdest thing to get it workingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes lol.. Dont even know how its working.. Just want to let you guys know there is something wrong!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, when converting multiple statements to sequence expressions, the comments are dropped. Should add a test case that this doesn't affect the surrounding block comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly.. add a separate test case?