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

refactor: move jest configs into presets #4597

Merged
merged 2 commits into from
Sep 23, 2019

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented Sep 19, 2019

This could significantly reduce the size of default jest boilerplate,
and gives us more control on the internal config details, thus
potentially making future upgrades easier.

Update: these presets are renamed in #4609

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

This could significantly reduce the size of default boilerplate,
and gives us more control on the internal config details, thus
potentially making future upgrades easier.
@haoqunjiang
Copy link
Member Author

Instead of adding a standalone @vue/jest-preset package, I chose to bundle the presets inside the plugin itself, mostly for easier dependency management, including peer dependency resolutions and compatability with yarn pnp & pnpm.
Unfortunately, the preset paths now become very long: '@vue/cli-plugin-unit-jest/preset/typescript-and-babel'. But as most users won't manually type this path, I think it's an acceptable tradeoff.

@haoqunjiang haoqunjiang changed the title refactor: move jest configs into a preset refactor: move jest configs into presets Sep 22, 2019
@haoqunjiang haoqunjiang merged commit 2e1e92b into vuejs:dev Sep 23, 2019
@haoqunjiang haoqunjiang deleted the jest-preset branch September 23, 2019 10:23
haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this pull request Sep 23, 2019
Follow up of vuejs#4597.
Renamed `preset` folder to `presets`.
Added a default preset and it is accessible in the short form of
`@vue/cli-plugin-unit-jest`.

This change is inspired by ts-jest presets:
https://kulshekhar.github.io/ts-jest/user/config/#jest-preset
@haoqunjiang haoqunjiang mentioned this pull request Sep 23, 2019
9 tasks
haoqunjiang added a commit that referenced this pull request Sep 24, 2019
* refactor: rename jest presets

Follow up of #4597.
Renamed `preset` folder to `presets`.
Added a default preset and it is accessible in the short form of
`@vue/cli-plugin-unit-jest`.

This change is inspired by ts-jest presets:
https://kulshekhar.github.io/ts-jest/user/config/#jest-preset

* fix: update import path

* fix: fix typo in file path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant