diff --git a/build/yaml/templates/component-template.yml b/build/yaml/templates/component-template.yml index 95bd8ca858..bd27ea611e 100644 --- a/build/yaml/templates/component-template.yml +++ b/build/yaml/templates/component-template.yml @@ -9,6 +9,7 @@ stages: displayName: Build Node project steps: - template: npm-build-steps.yml + - template: npm-test-steps.yml - stage: stage_package_node displayName: 'Node: Build, Version & Pack' @@ -18,6 +19,7 @@ stages: displayName: 'Build & Pack Node project' steps: - template: npm-build-steps.yml + - template: npm-test-steps.yml - template: npm-versioning-steps.yml - template: npm-package-steps.yml diff --git a/build/yaml/templates/npm-test-steps.yml b/build/yaml/templates/npm-test-steps.yml new file mode 100644 index 0000000000..06c8a40a15 --- /dev/null +++ b/build/yaml/templates/npm-test-steps.yml @@ -0,0 +1,26 @@ +steps: +# You are probably wondering "Why not just run 'yarn exec npm run --if-present test'?". +# On Azure Pipelines, yarn install by default restores modules to a global node_modules cache +# instead of a local package cache. When running the npm CLI, it is unable to resolve required +# dependencies as a result, whereas yarn run