steps: - script: npm i -g npm@$(npm_version) displayName: Use legacy npm version $(npm_version) condition: ne(variables['npm_version'], '') - task: NodeTool@0 inputs: versionSpec: '$(node_version)' displayName: Use Node $(node_version) - script: npm install displayName: npm install - script: npm test displayName: Run tests - script: npm run coveralls displayName: Run coveralls env: # Pretend to be AppVeyor for now APPVEYOR: true APPVEYOR_BUILD_NUMBER: $(Build.BuildNumber) APPVEYOR_BUILD_ID: $(Agent.OS)_$(node_version) APPVEYOR_REPO_COMMIT: $(Build.SourceVersion) APPVEYOR_REPO_BRANCH: $(Build.SourceBranchName) # Overwrite the AppVeyor Service Name COVERALLS_SERVICE_NAME: Azure Pipelines COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) COVERALLS_PARALLEL: true CI_PULL_REQUEST: $(System.PullRequest.PullRequestNumber) - script: npm run azure-pipelines displayName: Write tests to xml - task: PublishTestResults@2 inputs: testResultsFiles: '**/test.xunit' condition: succeededOrFailed()