pnp/cli-microsoft365

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

Open

#6.497 aberto em 18 de nov. de 2024

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (399 forks)auto 404
enhancementhelp wantedkeep-open

Métricas do repositório

Stars
 (1.390 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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

Guia do colaborador