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: test cases having non-deterministic behaviour #302

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

shrutiburman
Copy link
Contributor

@shrutiburman shrutiburman commented Oct 4, 2021

Fixes 136

Testing Gist

This PR solves:

  • Some test cases were not passing uniformly, when the process.env variable is modified to mock different terminals(failed when ran individually and passed when ran in the suite).

  • This is a known issue with mocha when combined with supports-color. supports-color is an internal dependency in supports-hyperlink.

  • This issue is resolved for Emacs users, however in IDE terminals it still causes problems, there's this agreed workaround which fixes it.

Screenshots:
In VSCode:
image
image

In IntelliJ:
image
image

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

const result = convertToHyperlink('MORE INFO', 'https://twilio.com/docs/dummyCmd').isSupported;
if ('CI' in process.env) {
Copy link
Contributor Author

@shrutiburman shrutiburman Oct 4, 2021

Choose a reason for hiding this comment

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

Since the hyperlink flag --hyperlink is set to true, it'll be honoured in CI environments too. Reference.

expect(
getFlagConfig(
{
name: 'DummyCmd',
schema: {
description:
"The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts).",
'The SID of the [Account](https://www.twi lio.com/docs/iam/api/account) to which the Sim resource should belong. ',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the gap twi lio is intentional ?

Copy link
Contributor Author

@shrutiburman shrutiburman Oct 4, 2021

Choose a reason for hiding this comment

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

Yes, that's to verify the markdown regex. With space it would be an invalid markdown. This is a useful reference to verify markdowns.

Copy link
Contributor

@ravali-rimmalapudi ravali-rimmalapudi left a comment

Choose a reason for hiding this comment

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

LGTM:rocket:.

@shrutiburman shrutiburman merged commit 85a11b9 into main Oct 6, 2021
@shrutiburman shrutiburman deleted the 136-fix-test-cases branch October 6, 2021 05:57
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

4 participants