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

Determine the "correct" project structure for ion-js #583

Open
zslayton opened this issue Mar 17, 2020 · 0 comments
Open

Determine the "correct" project structure for ion-js #583

zslayton opened this issue Mar 17, 2020 · 0 comments

Comments

@zslayton
Copy link
Contributor

ion-js has two directories with source code: src and test. Because it uses mocha+ts-node for its unit tests, the code in test is never actually compiled; ts-node interprets it dynamically as part of the mocha run. Because of this, there's no need to include test explicitly in our tsconfig.json. This led us to have a rootDir of "src".

Now that our tests are a bit more comprehensive/elaborate, it would be good to extract commonly referenced functions/values into reusable files in test. However, attempting to do this causes WebStorm to throw an error:

TS6059: .... `rootDir` is expected to contain all source files.

This occurs because test is not in the rootDir, src. This error only occurs in the WebStorm UI, which doesn't understand that we're using ts-node to run the contents of the test directory out-of-band. We can change src, but depending on how we do that it may impact the structure of the dist directory. We should investigate whether a prescribed solution exists.

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

No branches or pull requests

1 participant