Directory Structure Examples - msssk/intern GitHub Wiki

As of Intern 1.3 you may set loader.baseUrl to any value, which enables you to use arbitrary directory structures.

When creating tests for an application, as opposed to developing tests for a reusable component library like Dojo, we recommend placing the tests in a location that is outside of the normal source code tree rather than inside the code package directory. Doing so provides the following benefits:

  1. Production deployments are simplified by eliminating the need to exclude tests during the build process.
  2. The risk of accidental disclosure of security-sensitive information stored inside test files is eliminated, as data related to testing is never part of the directory structure that is exposed by production Web servers.
  3. By placing tests at a higher level than the files that will be accessed during testing, like the main index.html for the application, upward directory recursion outside package directories is eliminated.

Within the tests directory, code should be subdivided into three directories:

  • functional: Functional test suites
  • support: Testing support files: utility modules, mock data, custom reporters, custom interfaces, etc.
  • unit: Unit test suites

Example directory structure:

/
	app/
		widgets/
		index.html
	app-tests/
		functional/
		support/
		unit/
	node_modules/
		intern/