xolvio / qualityfaster

An example project showing how to create robust and maintainable acceptance tests
262 stars 58 forks source link

Linting issues #68

Open orangecms opened 7 years ago

orangecms commented 7 years ago

I have a Meteor project, and am using a globally installed Chimp as suggested, i.e. I do not have Mocha nor Chai in the project dependencies. There are now some drawbacks with linting:

  1. Since Chimp is injecting Mocha and Chai, instead of import { expect } from 'chai', I use the global expect. Because of that, I have /* global expect */ configured.
  2. When setting up tests, I need to require some libraries within Meteor's context. So I specify /* eslint-disable global-require */.
  3. Because the variables in the spec are not within Meteor's context then, I need to pass them on, and to avoid renaming them, I prefer to have the same var names. So I also specify /* eslint-disable no-shadow */. Otherwise I would have to prefix them, something like
browser.executeAsync((mFoo, done) => {
  /* do something with mFoo which is actually foo in the spec's scope */
}, foo);

That would be just a workaround though.

I don't want to confuse the actual project within this config, which is why I put this into all the specs. It looks quite ugly though. Are there plans maybe for a Chimp plugin for ESLint?

samhatoum commented 7 years ago

It's a great idea to make a Chimp ESLint plugin. Would love a PR on the Chimp repo :)