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

Chore: Reorganizing tests to align with project structure #46

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

platinumazure
Copy link
Member

Similar to ESLint and other projects in the ESLint organization, I reorganized the tests so that for each source file path/to/src.js, there would be a test file tests/path/to/src.js. (I renamed "test" to "tests" as part of that effort)

In order to make that work, I needed to change two things related to the mocha invocation:

  1. Pass a glob pattern `"tests/*/.js" to pick up all JS files in the tests directory.
  2. Move the temp directory out of tests, since unfortunately, some files are left between tests, including generated .js files which shouldn't be run as tests.

If this is acceptable, great; otherwise, let me know how I should improve this. Some possibilities:

  • Use a more specific glob pattern (e.g., "tests/{app,lib,plugin,rule}/*.js") to avoid picking up temp
    • Risk: If new test folders are added, package.json must be updated each time
  • Ensure tests clean up the test directory after themselves (even if exceptions are thrown)

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nzakas nzakas merged commit c19cd6d into master Sep 27, 2016
@platinumazure platinumazure deleted the chore-reorganize-tests branch September 28, 2016 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants