caolan / caolan/nodeunit

Adding include paths to CLI testrunner

Open
#67 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.9k
Forks
359
PR merge metrics
No merged PRs in 30d

Description

I think it would be useful to have something like --include=PATH for the CLI testrunner. That way you can setup your testsuite without having to know about the actual location of the test suite in the directory structure. The call to the CLI testrunner then can take care of setting up the enviroment using --include. No need to repeat

```
require =("../lib/LibrarySubjectToBeTested");
```

but do

```
require('LibrarySubjectToBeTested");
```

and simply call

```
nodeunit --include=../lib/
```

I implemented a patch that would add this functionality to the testrunner. Have a look at it: 1db0b284d70829d4fe5f8a1fe20274562cdc5bd8
Please let me know what you think and if there's anything I missed. If you like it, feel free to pull it in.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing commit 1db0b284d70829d4fe5f8a1fe20274562cdc5bd8 and the CLI testrunner entry point. Check how the proposed --include=PATH option sets the module lookup environment, then run the existing test suite; done means nodeunit --include=../lib/ permits requiring LibrarySubjectToBeTested without a relative path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.