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

added separate tsconfig for enzyme inheriting project configuration #10

Closed
wants to merge 2 commits into from
Closed

added separate tsconfig for enzyme inheriting project configuration #10

wants to merge 2 commits into from

Conversation

baywet
Copy link
Contributor

@baywet baywet commented Oct 8, 2019

this avoids having lots of issues when trying to run unit tests

- created seperate tsconfig for enzyme use
- enzyme tsconfig enables esinterop modules and inherits project config
Copy link
Member

@andrewconnell andrewconnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create another tsconfig.json file? There's already one in the root of this project... why add a 2nd one in /resources?

Generally, like the approach of inheriting the parent's tsconfig.json.

@baywet
Copy link
Contributor Author

baywet commented Oct 8, 2019

I created a second one because I didn't want the one we need for the ts-jest to conflict with the one you need to build the current package.
IE: for the current package you need to include those

"include": [
    "postinstall/*.ts"
  ],

and you only load the node libraries.

Unit tests on an SPFx project need more than that/different things.

So the reasons are:

  • separation of concerns (both for the consumer project and the current project)
  • overriding only what we need (hence the extend) / staying as close as possible to the SPFx configuration

@andrewconnell
Copy link
Member

Got it... makes sense and a good idea. I'm going to change what you've done though to make it clearer as right now /resources/tsconfig.json isn't obvious what it's used for. Thanks!

@baywet
Copy link
Contributor Author

baywet commented Oct 14, 2019

Feel free to edit my PR. You should have permissions.

andrewconnell added a commit that referenced this pull request Oct 14, 2019
- previous fix in 1.3.1 introduced regression
- this configures ts-jest prepreocessor to use same TSC compiler options as the project, but makes one mod to address issue that was fixed in 1.3.1
- incorporates fix submitted in PR #10, but implemented in a different way
@andrewconnell
Copy link
Member

Closing due to being outdated. Great suggestion and used it as the baseline for the fix in v1.3.2

@baywet baywet deleted the bugfix/tsconfig branch October 14, 2019 20:06
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 this pull request may close these issues.

2 participants