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

fix(jest-serializer): issue when value is null #103

Conversation

rochejul
Copy link
Contributor

PR related to #102 issue

The PR contains a test file for index.js and then tests related to the "test" function.

The test function has evolved to:

  • Always return a boolean
  • Take care of null value

Here a screenshot of the tests:
Screenshot 2020-10-13 at 09 30 38

Copy link
Member

@pmdartus pmdartus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, added a couple of comments.

.gitignore Outdated
.vscode/
.history/
Copy link
Member

Choose a reason for hiding this comment

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

Why ignoring .history folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a VScode plugin for code history which create an ".history" folder. And so to avoid to commit, we should ignore it.

If needed, I could revert it

packages/@lwc/jest-serializer/src/__tests__/index.spec.js Outdated Show resolved Hide resolved
packages/@lwc/jest-serializer/src/__tests__/index.spec.js Outdated Show resolved Hide resolved
packages/@lwc/jest-serializer/src/__tests__/index.spec.js Outdated Show resolved Hide resolved
packages/@lwc/jest-serializer/src/__tests__/index.spec.js Outdated Show resolved Hide resolved
packages/@lwc/jest-serializer/src/index.js Outdated Show resolved Hide resolved
Comment on lines -17 to +23
nodeType === 6) // comment
nodeType === 8 // comment
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With "document.createComment" (and according to MDN), the comment's nodeType is 8 (6 represents the ENTITY instruction for DTD)

Copy link
Member

Choose a reason for hiding this comment

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

Good catch.

@pmdartus pmdartus merged commit a02a08b into salesforce:master Oct 13, 2020
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.

2 participants