Update the `azuredevops pipeline add` and `github workflow add` with option to scaffold running tests step
#6,497 创建于 2024年11月18日
仓库指标
- Star
- (1,390 star)
- PR 合并指标
- (PR 指标待抓取)
描述
Currently the spfx project azuredevops pipeline add and spfx project github workflow add will scaffold a perfectly good workflow which builds, packages and deploys the SPFx project. One thing which is missing is running tests. This is also a usual thing we do in our deployment pipelines which is a good practice to include as a safety check before something will get deployed. Of course, if we have tests in our SPFx project 😜.
So my idea is to a new option
-t, --runTests - flag, when included in the command it will also scaffold a step that will run gulp test
for Azure DevOps it should add a step like
- task: Gulp@0
displayName: Gulp test
inputs:
targets: test
before the bundle task.
and for GitHub workflow it could be something like
- name: Bundle & Package
run: |
gulp test