Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore fdescribe in Jasmine

One of the developers on our team (me) keeps accidentally checking in fdescribe and fit in Jasmine tests. Which sometimes results in masking broken tests.

Is there an easy way to either fail a build (TFS) if fdescribe is used, or (better?) configure jasmine server side to treat fdescribe (and fit) as regular describe (and it)?

I would rather use those then fall back to ?spec approach.

I also would like to take this opportunity to apologize for doing that.

like image 386
THX-1138 Avatar asked Oct 17 '25 23:10

THX-1138


1 Answers

We've approached it with static code analysis and eslint.

There is a specific plugin: eslint-plugin-jasmine, see:

  • Disallow use of focused tests (no-focused-tests)

Sample output:

test/e2e/specs/test.spec.js
  5:0  error  Unexpected fdescribe  jasmine/no-focused-tests

Currently, the plugin also checks for disabled tests and duplicate suite names.

like image 187
alecxe Avatar answered Oct 20 '25 13:10

alecxe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!