eugef / node-mocks-http

Mock 'http' objects for testing Express routing functions
Other
753 stars 133 forks source link

provide ESLint plugin for underscore dangle test methods #186

Closed AndyOGo closed 4 years ago

AndyOGo commented 5 years ago

First thanks for this awesome mocks, I really love to use it.

Just a minor thing, all _-dangle prefix test functions break my eslint config cause of no-underscore-dangle rule.

I quickly looked at your code an came up with this eslint config:

{
   "rules": {
        "no-underscore-dangle": ["error", {
          "allow": ["_setParameter", "_setSessionVariable", "_setCookiesVariable", "_setSignedCookiesVariable", "_setHeadersVariable", "_setFilesVariable", "_setMethod", "_setURL", "_setBaseUrl", "_setOriginalUrl", "_setBody", "_addBody", "_isEndCalled", "_getHeaders", "_getLocals", "_getData", "_getJSONData", "_getBuffer", "_getChunks", "_getStatusCode", "_getStatusMessage", "_isJSON", "_isUTF8", "_isDataLengthValid", "_getRedirectUrl", "_getRenderView", "_getRenderData"]
        }]
  }
}

I thought it would make sense to turn it into a generic plugin.

github-actions[bot] commented 4 years ago

Stale issue message