Skip to content
This repository was archived by the owner on Jun 29, 2020. It is now read-only.
This repository was archived by the owner on Jun 29, 2020. It is now read-only.

Add option to choose which test file to run from the command line. #20

@reuvenpo

Description

@reuvenpo

https://github.com/enigmampc/discovery-cli/blob/e3e9a438738d50a1fc4e987f2508f2b9b08a5a66/src/contracts.js#L46

In this function, we should read the command line arguments after test and treat each as a file path. These paths should be normalized and then compared to the files listed in config.test_files. If a file listed on the command line does not exist in the filesystem, then an error should be issued. If there are files listed on the command line, and they all refer to existing paths under the tests directory(this is important for security reasons to prevent arbitrary code execution), then those files should replace the list under config.test_files.

As the title suggests, this will allow limiting the set of tests that run under discovery test from the command line.

EDIT:
I tried looking at the relevant code in truffle (1, 2) but it doesn't seem like it actually reads the environment variables either, even though the documentation says it should. Since our test command just calls the same function in truffle as truffle's test command (1, 2, 3), I'm somewhat confused.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions