Skip to content

Skip tests by name or pattern (opposite of -E|--example) #362

Description

@Da-Buche

It would be nice to have a way to skip some tests by name or pattern.

Context

I want to share spec files between projects to avoid duplicating them.
It is mostly code quality to report big files, Windows characters, trailing whitespace, ...

However I need to support the case when one project has a good reason to skip any test.

Example

I tried :

disabled() { grep -q "$1" skipped_tests.txt }

TEST_NAME="contains no big files."
It "$TEST_NAME"
Skip if "in skipped_tests.txt" disabled "$TEST_NAME"
...
End

It could do the job but breaks some features, for instance to use -E, I need to do :
shellspec -E '$TEST_NAME'
which makes no sense...

I think :
shellspec --skip <pattern>
and
shellspec --skip-file <file containing patterns>
could be nice options

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions