-
-
Notifications
You must be signed in to change notification settings - Fork 239
ESLint failing tests #62
Comments
Sure, this would be great. Bit hard to ensure that these issues actually get fixed unless I can repeatedly run the test suite. |
Right now I am working with eslint-tester to provide a way to change the config for all test cases https://github.com/eslint/eslint-tester/issues/19 However, in order to run the tests, I simply added a field on the ESlintTester prototype that would be used to set the parser for the tests. var ESLintTester = require("eslint-tester");
ESLintTester.defaultParser = "babel-eslint"; Then every test ran after that point would use |
Please don't quote me on this, but might it be a change in the eslint api? I noticed this started to happen when eslint went from 0.16 to 0.17. We just locked the version to 0.16 and everything was fine, but then babel-eslint got update and the error got triggered again. It also happens on eslint 0.19. |
In my case the main problem seems to be recognizing that JSX is using certain variables. It will trigger no-unused-var for all JSX elements. |
Locking to the following versions: |
+1 for this |
@Cellule I'm probably just bad at following your instructions (and haven't been able to get this working myself) - have you been able to get farther on this? It definitely would be awesome to be able to run against all ESLint tests. |
The problem is that my change to have a default configuration in eslint-tester hasn't been approved yet. see eslint/eslint-tester#20 So what you can do is clone eslint then run var ESLintTester = require("eslint-tester");
ESLintTester.setDefaultConfig({
parser: "babel-eslint"
}); and then run It's not very clean, but it gets the job done. |
Ok I'l try it out tomorrow - and looks like there's less tests failing! |
If you want you can try my branch It's not perfect, I've done this real quick tonight and there are some false negative (some tests also fails with espree), but at least you can see some tests with minimal setup. |
Just to let you guys know, I just published new version of eslint-tester that includes ability to provide default configuration, including parser that @Cellule submitted. |
Ok thanks @ilyavolodin (and @Cellule), I'l check it out. So I need to be able to run somewhere var ESLintTester = require("eslint-tester");
ESLintTester.setDefaultConfig({
parser: "babel-eslint"
}); and then run all the ESLint tests? What do you guys think would be the best way to integrate the tests into the project so we can test against regressions as well as fix the already failing tests? - ESLint is already a devDependency |
The problem is that having eslint as a dependency doesn't come with the tests. So right now no matter how you look at it you need to have your own copy of eslint and then run the tests. You can either modifiy eslint to run the tests with babel-eslint or use my (very hacky) branch of babel-eslint to run the eslint test suite (which is a bit less reliable). |
Looks simple enough - my idea was to use a git sub module or something // 88 failing tests |
Add eslint submodule to run eslint tests - Ref #62
@Cellule not really sure what we can do - a lot of the failing tests aren't an issue - strict mode, etc. |
We're going to have to find a way to mark or disregard these tests we know are false negatives. Right now I don't have any idea since we don't want to edit the source code of the tests. |
Looking into this and this is the current output from the tests:
Been trying to figure out where that comes from...Will keep digging |
It's prob b/c babel-eslint has strict mode by default (since you are using modules, etc) and eslint uses with in it's tests |
@hzoo Ah, that makes sense...Hm, so how did they ever work? |
It didn't actually - there were always failing tests |
It sounded like it was running some of the tests, though - or maybe I misunderstood. What I pasted above is the entire output at the moment - doesn't run any of them :( |
Yeah I guess it changed in the time since I ran them? It looks like it's just stopping on the first failing one rather than running it all |
I see - yeah, these error messages are not super helpful, unfortunately. When I set |
Going to close this in favor of #739 |
Add eslint submodule to run eslint tests - Ref babel/babel-eslint#62
Hi, recently I have encountered quite a few problems with ESLint because I used babel-eslint. I would really like to keep using it for its better support for es6 and jsx.
I wanted to have an overview of the problems with babel-eslint so I executed ESLint test suite using babel-eslint and I wanted to share my results here.
The test suite found 115 failing test cases affecting 26 rules.
the rules are
and you can see the detailed errors in the gist below (I enhanced a bit eslint-tester to have more information about failing tests)
https://gist.github.com/Cellule/37e1231437b1a28cdf46
I hope this can help solve most discrepancies between espree and babel-eslint.
If you want I can share how I ran the test suite since there is no official support at the moment.
The text was updated successfully, but these errors were encountered: