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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testlab): add generic helper skipOnTravis #3040

Merged
merged 1 commit into from
Jun 6, 2019

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Jun 4, 2019

Introduce a generic helper skipOnTravis that supports arbitrary BDD verbs (it, describe, etc.) in a test-framework-agnostic way. Rework itSkippedOnTravis to leverage the new helper and deprecate it (in tsdocs only).

This is a follow-up for #3013.

Checklist

馃憠 Read and sign the CLA (Contributor License Agreement) 馃憟

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

馃憠 Check out how to submit a PR 馃憟

@bajtos bajtos self-assigned this Jun 4, 2019
@bajtos bajtos force-pushed the feat/generic-skip-on-travis branch from cd73ca5 to ab16360 Compare June 4, 2019 07:47
@bajtos bajtos added the Testlab @loopback/testlab label Jun 4, 2019
* implementing the test.
*/
export function skipOnTravis<ARGS extends unknown[], RETVAL>(
verb: TestDefinition<ARGS, RETVAL> & {skip: TestDefinition<ARGS, RETVAL>},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make verb default to it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer not to. Without the verb, it would be difficult to understand whether we are defining a test case (it()) or a test suite (describe()) or something else (context()).

skipOnTravis('returns some value when some conditions', async () => {
 // the test
});

Introduce a generic helper `skipOnTravis` that supports arbitrary
BDD verbs (`it`, `describe`, etc.) in a test-framework-agnostic way.

Rework `itSkippedOnTravis` to leverage the new helper and deprecate it
(in tsdocs only).

Signed-off-by: Miroslav Bajto拧 <mbajtoss@gmail.com>
@bajtos bajtos force-pushed the feat/generic-skip-on-travis branch from ab16360 to 392e850 Compare June 6, 2019 06:57
@bajtos bajtos merged commit 3221d9f into master Jun 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/generic-skip-on-travis branch June 6, 2019 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testlab @loopback/testlab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants