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

Cannot run with non-default tests location #44

Open
robyoder opened this issue Jan 26, 2022 · 2 comments · May be fixed by #46
Open

Cannot run with non-default tests location #44

robyoder opened this issue Jan 26, 2022 · 2 comments · May be fixed by #46

Comments

@robyoder
Copy link

I've created a sample project to show the problem.

STR

  1. Install elm, elm-coverage, and elm-test globally.
  2. elm-coverage client/src -t client/tests

Expected

It would work. This is the documented way to reference src and test files in non-default locations.

Actual

[11:07:31.31] Instrumenting sources...
[11:07:31.36] Running tests...

[11:07:31.44] Ruh roh, tests failed.
[11:07:31.44] Something went wrong:
Error: The "source-directories" field in your elm.json lists the following directory:

/Users/rob/Projects/elm-coverage-bug/.coverage/instrumented/client/tests

It doesn't exist though. Is it missing? Is there a typo?

Looking in the .coverage/instrumented directory, the elm.json file contains "source-directories":["client/src","client/tests"], but the actual directory structure is:

instrumented
- client
  - src
- tests
- elm.json

So it looks like the tests directory just doesn't get copied over correctly.

@robyoder robyoder linked a pull request Jan 27, 2022 that will close this issue
@simonh1000
Copy link

I have a similar issue. Our elm.json lists

    "source-directories": [
        "src",
        "../shared",
        "Migrations"
    ],

and I'm seeing

Error: The "source-directories" field in your elm.json lists the following directory:

/path/to/elmjson/.coverage/shared

If I remove ../shared it gets passed this stage, but then (unsurprisingly) does not compile

@robyoder
Copy link
Author

@simonh1000 I have a PR open for this here, but it's not received any attention yet. I have an install branch so that I can install the package directly from my fork. Could you try updating your package.json to "elm-coverage": "github:robyoder/elm-coverage#install" and see if it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants