pnp/cli-microsoft365

Update the `azuredevops pipeline add` and `github workflow add` with option to scaffold running tests step

Open

#6,497 创建于 2024年11月18日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)TypeScript (399 fork)auto 404
enhancementhelp wantedkeep-open

仓库指标

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

贡献者指南