Skip to content
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

Move lib/*.js files used only in tests to tests/lib (or something) #143

Open
JasonEtco opened this issue Sep 24, 2020 · 2 comments
Open

Move lib/*.js files used only in tests to tests/lib (or something) #143

JasonEtco opened this issue Sep 24, 2020 · 2 comments

Comments

@JasonEtco
Copy link
Member

@JasonEtco JasonEtco commented Sep 24, 2020

While reviewing github/docs-internal#15734, I had a difficult time grokking which code was used during runtime vs. only in tests/local scripts. I've thought that a couple of times - we don't currently have a clear separation of that code. Generally speaking, lib is used for runtime code - stuff to run the server. Code solely used for tests often lives in like a tests/helpers directory or something.

Interested in how y'all feel @github/docs-engineering, if this is just me or if others have felt this confusion as well.

@zeke
Copy link
Member

@zeke zeke commented Sep 24, 2020

Keeping test utils in their own directory in /tests/something sounds good to me.

Do you have any examples of this?

@sarahs
Copy link
Contributor

@sarahs sarahs commented Sep 24, 2020

The two I can think of are lib/check-images.js and lib/check-links.js. I agree those can live in the test dir. 👍

There is also lib/remove-liquid-statements.js, which we don't use in runtime code, but we use it in scripts as well as tests. So lib seems OK for that one since it's used in multiple places.

Are there others you noticed, @JasonEtco?

@zeke zeke transferred this issue from another repository Oct 6, 2020
@github-actions github-actions bot added the triage label Oct 6, 2020
@github-actions github-actions bot added this to Triage in Docs team reviews Oct 6, 2020
@zeke zeke added engineering and removed triage labels Oct 6, 2020
@chiedo chiedo moved this from Triage to Engineering in Docs team reviews Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.