Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull Request Check #1114

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Calculator.js: a node.js Demonstration Project
==============================================
An example node.js project, including tests with mocha, that behaves like
a pocket calculator.

[![Build Status](https://dev.azure.com/k200455/Integrating%20External%20Source%20Control%20with%20Azure%20Pipelines/_apis/build/status%2FSM-Kumail-Rizvi.calculator?branchName=master)](https://dev.azure.com/k200455/Integrating%20External%20Source%20Control%20with%20Azure%20Pipelines/_build/latest?definitionId=3&branchName=master)
The project contains a simple node.js application that exposes REST APIs
to perform arithmetic on integers, and provides a test suite with mocha
and chai. The `mocha-junit-reporters` package is included to provide XML
Expand Down
1 change: 1 addition & 0 deletions api/controllers/arithmeticController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports.calculate = function(req, res) {
});

var operations = {
// Using + operator to type cast variables as integers in order to prevent string concatenation.
'add': function(a,b) { return +a + +b },
'subtract': function(a,b) { return a - b },
'multiply': function(a,b) { return a * b },
Expand Down
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- master

pool:
vmImage: ubuntu-latest

steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'

- script: |
npm install
npm run build
npm test
displayName: 'npm install, build, and test'