Skip to content

Feature Request: Support for intended fail-scenario #146

@shani-terminus

Description

@shani-terminus

I would like a way to verify a fail scenario to insure code properly messages invalid parameters.

For example:

@mixin theme-color($property: 'background-color') {
  // Verify an allowed property was passed in
  @if not(($property == background-color)) and not(($property == color)) {
    @error 'The `theme-color` mixin only accepts `background-color` or `color`';
  }
---- do stuff ----
}

Test:

@include test('should fail with invalid property') {
    @include assert-fail {
      @include output {
        @include theme-color(foo);
      }
      @include expect {
        @include fail-message('The `theme-color` mixin only accepts `background-color` or 'color`');
      }
    }
  } 

Today when I attempt a test like this, I get the fail-message in the terminal, however, the test itself fails and my other tests don't run.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions