Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

question : a function named pending () triggered the 'no-disabled-tests' error. my bad? #149

Closed
lsuarez-tiempo-dev opened this issue Sep 3, 2018 · 3 comments · Fixed by #155

Comments

@lsuarez-tiempo-dev
Copy link

I just read that pending is a jasmine global that allows you not run the test.
effectively disabling it.

Our code imports a value and then runs its it.
It appears the parser is confusing it with the jasmine global.
without being to careful with the syntax, This is basically what we're doing:

import { pending } from './myActions' ; 

describe('the pending action creator should return correct object', ()=>{
    it('should work correctly' , ()=>{
      expect(pending()).toStrictEqual({type:'FETCH_ALL_ALBUMS_PENDING'});
   })
})

does this rule notice if you import the function before assuming you're using the jasmine global and hence, disabling the test?
or is it an issue with the code?

@lsuarez-tiempo-dev lsuarez-tiempo-dev changed the title a function named pending () triggered the 'no-disabled-tests' error question : a function named pending () triggered the 'no-disabled-tests' error. my bad? Sep 3, 2018
@SimenB
Copy link
Member

SimenB commented Sep 3, 2018

A PR fixing this would be most welcome! We should only detect usage of a global pending calls, not locally declared or imported ones

@macklinu
Copy link
Collaborator

I'll push up a PR for this one. 👍

@SimenB
Copy link
Member

SimenB commented Sep 21, 2018

🎉 This issue has been resolved in version 21.22.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants