Skip to content
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

PDE-4495 fix(cli): zapier convert crashes due to syntax error in user's code and should not replace source in sample #730

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

eliangcs
Copy link
Member

@eliangcs eliangcs commented Nov 27, 2023

Fixes two bugs in the zapier convert command.

Before (current behavior):

  1. When there's a syntax error in user's code (the code the developer wrote in Code Mode), zapier convert would fail because we didn't catch the error raised from Prettier, the code formatter used in zapier convert.
  2. When a sample has a field named source (there's an example in the test code), zapier convert would incorrectly replace it with a function, which then would cause Prettier to error.

After (expected behavior):

  1. When there's a syntax error in user's code, zapier convert will print an warning and carry on the conversion. It will leave the bad code as is without prettifying.
  2. When a sample has a field named source, zapier convert won't replace it with a function.

@eliangcs eliangcs changed the title fix(cli): zapier convert crashes due to syntax error in user's code fix(cli): zapier convert crashes due to syntax error in user's code and should not replace source in sample Nov 27, 2023
@eliangcs eliangcs marked this pull request as ready for review November 27, 2023 09:59
@eliangcs eliangcs requested a review from rnegron as a code owner November 27, 2023 09:59
@eliangcs eliangcs changed the title fix(cli): zapier convert crashes due to syntax error in user's code and should not replace source in sample PDE-4495 fix(cli): zapier convert crashes due to syntax error in user's code and should not replace source in sample Nov 27, 2023
should(hydratorsFile.includes('{ bad code }')).be.true();
});

it("should not replace 'source' in sample", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Great tests! 💯

@eliangcs eliangcs merged commit a63fda8 into main Nov 28, 2023
13 checks passed
@eliangcs eliangcs deleted the PDE-4495-convert-bugs branch November 28, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants