Code files
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const request = require('superagent')
|
||||
const { test } = require('tap')
|
||||
|
||||
test('add test', (t) => {
|
||||
t.plan(2)
|
||||
|
||||
request
|
||||
.post('http://localhost:3000/add/calculate')
|
||||
.send('first=1')
|
||||
.send('second=2')
|
||||
.end((err, res) => {
|
||||
t.equal(err, null)
|
||||
t.ok(/result = 3/ig.test(res.text))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "inttest",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Peter Elger",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"superagent": "^3.5.2",
|
||||
"tap": "^10.3.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user