Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8610843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:13:24+00:00 2026-06-12T04:13:24+00:00

Is it ok to store test file in the location of module itself: Lets

  • 0

Is it ok to store test file in the location of module itself:

Lets say I have a structure:

project\
  module1\
    submodule\
       submodule.js
       submodule.test.js

Or it is better to make a separate location that will repeat the structure of the project:

project\
  module1\
    submodule\
       submodule.js
tests\
  module1\
    submodule\
       submodule.js

I’ve seen both variants. What considerations should be taken?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:13:25+00:00Added an answer on June 12, 2026 at 4:13 am

    Projects pretty universally keep the tests in a separate location, but don’t necessarily repeat the project structure. The test structure is usually flatter than the project structure.

    You can see some examples of how people do it at:
    https://github.com/visionmedia/express
    https://github.com/learnboost/mongoose
    https://github.com/mbostock/d3

    As to why it is done this way, it makes executing the tests easier since they are all in one folder and makes packaging code easier since the source files and test files aren’t intermixed. It also helps when doing things like code coverage builds since you need to instrument all of your source files but don’t want to instrument your test code.

    In general, whenever I have questions about project structure I just look at popular projects on GitHub and borrow liberally 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I store Guava Library and a testing file Test.java in C:\Program Files\Java\jdk1.6.0_25\bin and execute
Similar to What is the best format to store test data in a file?
I have written a service that monitors a file drop location for files from
I have a url of the wav file http://xyz.com/recordings/employees/test.wav What i want to know
Is there a way I can store the file location of the 5 last
I have compiled a simple ASP.NET project to test first data global gateway API
STORE = { item : function() { } }; STORE.item.prototype.add = function() { alert('test
I have a table which stores test results like this: user | score |
I have a stored procedure'test' in Sybase ASA with for example 4 parameters. par1
I have table to test score data that I need to pivot and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.