Skip to content

Commit

Permalink
updated transform parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Juarez committed Mar 7, 2017
1 parent 5735ae1 commit 168331c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion transforms/__testfixtures__/chai-to-jasmine/a-an.input.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ expect(undefined).to.be.an('undefined');
expect(new Error).to.be.an('error');
expect(new Promise).to.be.a('promise');
expect(new Float32Array()).to.be.a('float32array');
expect(Symbol()).to.be.a('symbol');
expect(Symbol()).to.be.a('symbol');
2 changes: 1 addition & 1 deletion transforms/__testfixtures__/chai-to-jasmine/a-an.output.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ expect(undefined).toBeUndefined();
expect(typeof new Error).toBe('error');
expect(typeof new Promise).toBe('promise');
expect(typeof new Float32Array()).toBe('float32array');
expect(typeof Symbol()).toBe('symbol');
expect(typeof Symbol()).toBe('symbol');
2 changes: 1 addition & 1 deletion transforms/chai-to-jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ module.exports = function transformer(file, api) {
mutations += updateCallExpressions();
mutations += updateMemberExpressions();

return mutations ? root.toSource({ quote: 'single' }) : null;
return mutations ? root.toSource({ parser: require('babel-eslint'), quote: 'single' }) : null;
};

module.exports.parser = 'babylon';

2 comments on commit 168331c

@skovhus
Copy link

@skovhus skovhus commented on 168331c Apr 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexJuarez I'm wondering what this actually does? Do you have an example of where this changes the output?

@AlexJuarez
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this preserves original white space better than the default parser afaik. The change is to address #2

Please sign in to comment.