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

277 add test to verify license identifier placement in files #278

Merged

Conversation

r59q
Copy link
Collaborator

@r59q r59q commented Jul 28, 2023

Adds a test that will check that all files in /src/ have a license identifier, ensuring all future files includes it before pushing to main branch. Workflow should succeed after #276 has been merged. Merge that first.
files can be excluded from the list if required.

// Place files you wish to ignore by name in here
const ignoredFiles: string[] = [];

It also gives you a list of files that are missing identifiers

image

@r59q r59q linked an issue Jul 28, 2023 that may be closed by this pull request
@r59q r59q requested a review from Karlo-Emilo July 28, 2023 08:41
@Karlo-Emilo
Copy link
Collaborator

I understand that the new test should fail, but is seems like it completes with an error. Is it intended?

@r59q
Copy link
Collaborator Author

r59q commented Jul 28, 2023

I understand that the new test should fail, but is seems like it completes with an error. Is it intended?

Well it depends on what jest considers an error. All but the new test succeed. Therefore it reports an error. However there are no compilation issues.
The logs and warnings are, although obnoxious, just a product of the tests themselves. If we test that a given procedure should fail and result in an error, when running the test an error will be thrown and be printed in the console alongside a stack trace. However this was the expected output of the test, and therefore it will pass.

As long as jest produces and spits out a result, we are good.

i.e if we see the following, the tests ran successfully
image

@Karlo-Emilo Karlo-Emilo merged commit 1ef7df6 into main Jul 28, 2023
3 checks passed
@Karlo-Emilo Karlo-Emilo deleted the 277-add-test-to-verify-license-identifier-placement-in-files branch July 28, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test to verify license identifier placement in files
2 participants