-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add snapshot tests for plugins #165
Conversation
@@ -1,4 +1,4 @@ | |||
{ | |||
"extends": "./tsconfig.build.json", | |||
"include": ["src"] | |||
"include": ["src", "snapshots"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call 👍
Since we're generating both ts and dts - which one will be compiled though? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really only useful for eslint so it can compile those files. It's a little weird and more finicky than I'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually also just for the IDE + test + lint, whereas tsconfig.build.json
is used for the build itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. What I mean is that there is ambiguity in general when you have x.js, x.ts, and x.d.ts all in the same directory, for any tool that processes the files.
I just checked with npm exec eslint -- snapshots/gen/connectrpc/eliza/v1 --debug
, and see that eslint does lint each file individually.
It would not have caught #166 though.
That's fine for now - the "snapshots" will make changes reviewable, which is a big improvement.
Cut connectrpc/connect-es#824, because we don't do better there either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, got confused by github and replied down below. This change should catch any TS leaking into the javascript, but we probably need a more dedicated way to test these kinds of things (because we don't know which will be imported, as you mentioned).
@@ -1,4 +1,4 @@ | |||
{ | |||
"extends": "./tsconfig.build.json", | |||
"include": ["src"] | |||
"include": ["src", "snapshots"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. What I mean is that there is ambiguity in general when you have x.js, x.ts, and x.d.ts all in the same directory, for any tool that processes the files.
I just checked with npm exec eslint -- snapshots/gen/connectrpc/eliza/v1 --debug
, and see that eslint does lint each file individually.
It would not have caught #166 though.
That's fine for now - the "snapshots" will make changes reviewable, which is a big improvement.
Cut connectrpc/connect-es#824, because we don't do better there either.
Aww man, I actually had triggered an error and caught the |
@timostamm Ah ok, my testing was just flawed (changing the wrong plugin). The linter does catch #166:
|
And I ran |
Update CI to check for untracked files (as suggested by @smaye81). First PR part of #160.
Few minor adjustments