-
Notifications
You must be signed in to change notification settings - Fork 79
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,32 +201,60 @@ describe('services', () => { | |
}); | ||
|
||
describe('getFlagConfig : checking for hyperlink in markdowns', () => { | ||
beforeEach(flush); | ||
afterEach(() => { | ||
flush(); | ||
process.env = ORIG_ENV; | ||
delete process.env.FORCE_HYPERLINK; | ||
}); | ||
|
||
test.it('handles a description on a non-supported terminal : MAC', () => { | ||
test.it('handles a description on a supported terminal : iTerm', () => { | ||
process.env.TERM_PROGRAM = 'iTerm.app'; | ||
process.env.TERM_PROGRAM_VERSION = '3.1.0'; | ||
process.env.FORCE_HYPERLINK = 1; | ||
const desc = 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).", | ||
type: 'string', | ||
}, | ||
in: 'query', | ||
required: false, | ||
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).", | ||
}, | ||
{ | ||
domainName: 'foo', | ||
path: '/v1/Bars', | ||
}, | ||
).description; | ||
expect(desc).to.contain('\u001b]8;;https:'); | ||
}); | ||
|
||
test.it('handles a description which doesnt match the regex, on a supported terminal : iTerm', () => { | ||
process.env.TERM_PROGRAM = 'iTerm.app'; | ||
process.env.TERM_PROGRAM_VERSION = '3.1.0'; | ||
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. ', | ||
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. Is the gap 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. Yes, that's to verify the markdown regex. With space it would be an invalid markdown. This is a useful reference to verify markdowns. |
||
type: 'string', | ||
}, | ||
in: 'query', | ||
required: false, | ||
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. ', | ||
}, | ||
{ | ||
domainName: 'foo', | ||
path: '/v1/Bars', | ||
}, | ||
).description, | ||
).to.contain('[Account](https://www.twilio.com/docs/iam/api/account)'); | ||
).to.not.contain('\u001b]8;;https:'); | ||
}); | ||
|
||
test.it('handles a description on a non-supported terminal : MAC', () => { | ||
|
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.
Since the hyperlink flag
--hyperlink
is set totrue
, it'll be honoured in CI environments too. Reference.