-
Notifications
You must be signed in to change notification settings - Fork 3
Add more tests and/or lint #78
Comments
I think we should add more tests, that should not be too hard. If there are situations we cannot tests with unit tests, even adding e2e API tests would be OK here |
Findings so far: Did some research on this, find out that eslint does not care of this kind of issue. See eslint/eslint#16176 (comment) But there is an eslint plugin called One another approach can be the use of typeScript where we can configure the node base as https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#tsconfig-bases. |
In PR #128, I have made the node and eslint parser versions strict so that the incompatible versions and codes are reported. With this, we can get early feedback in ci as well as locally. |
@saw-jan can we detect issues like the following now (with yours PR) with eslint?
|
Yeah, 99% sure 😄 For example: class Test {
static data = "some value"
} But eslint will report that as assignment to static member is the feature available from ecma2022 2:15 error Parsing error: Unexpected token =
✖ 1 problem (1 error, 0 warnings) |
With PR #128, there is a restriction to the js features we can use in the code and the eslint will report that. As per the tests, we could think of any better way. The problem with |
Yes, for the code in stepDefs, I think adding API acceptance tests would be good. |
We will need to have a thorough discussion on how to add those API tests and also discuss the feasibility and benefits of those tests. |
I think adding more API tests for this is over engineering. Let's close this for now as a lot of issues should be caught by the linter |
We had this problem today that
replaceAll
was used in some code. ButreplaceAll
is not supported until nodejs 15 or later. See PR #76 for some details.It would be nice to know in CI if new code uses some nodejs feature that does not exist in the nodejs version being used in the docker image. I tried running the lint with nodejs 14, but lint still passed - see PR #77
Maybe there is some other code analysis tool that will quickly tell us about node version compatibility problems?
Or we make more unit and/or integration tests that will actually execute each piece of code. That should cause fails when executed with a nodejs version that is too old for the code.
For discussion...
The text was updated successfully, but these errors were encountered: