mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fix: uncomment testsuite (#234)
* fix: uncomment testsuite * fix: uncomment testsuite * fix: unstable testcases * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: uncomment testsuite * fix: unstable testcase * fix: uncomment testsuite * wip: test * wip: test * wip: test Co-authored-by: Quan HL <quanluuhoang8@gmail.com>
This commit is contained in:
@@ -22,6 +22,8 @@ test('\'dial-phone\'', async(t) => {
|
||||
const {srf, disconnect} = require('../app');
|
||||
try {
|
||||
await connect(srf);
|
||||
// wait for fs connected to drachtio server.
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
|
||||
// GIVEN
|
||||
const from = "dial_success";
|
||||
@@ -46,15 +48,12 @@ test('\'dial-phone\'', async(t) => {
|
||||
const p = sippUac('uas-dial.xml', '172.38.0.10', undefined, undefined, 2);
|
||||
|
||||
let account_sid = '622f62e4-303a-49f2-bbe0-eb1e1714e37a';
|
||||
|
||||
let post = bent('http://127.0.0.1:3000/', 'POST', 'json', 201);
|
||||
post('v1/createCall', {
|
||||
'account_sid':account_sid,
|
||||
"call_hook": {
|
||||
"url": "http://127.0.0.1:3100/",
|
||||
"method": "POST",
|
||||
"username": "username",
|
||||
"password": "password"
|
||||
},
|
||||
"from": from,
|
||||
"to": {
|
||||
@@ -82,7 +81,8 @@ test('\'dial-sip\'', async(t) => {
|
||||
const {srf, disconnect} = require('../app');
|
||||
try {
|
||||
await connect(srf);
|
||||
|
||||
// wait for fs connected to drachtio server.
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
// GIVEN
|
||||
const from = "dial_sip";
|
||||
let verbs = [
|
||||
@@ -113,8 +113,6 @@ test('\'dial-sip\'', async(t) => {
|
||||
"call_hook": {
|
||||
"url": "http://127.0.0.1:3100/",
|
||||
"method": "POST",
|
||||
"username": "username",
|
||||
"password": "password"
|
||||
},
|
||||
"from": from,
|
||||
"to": {
|
||||
@@ -151,7 +149,8 @@ test('\'dial-user\'', async(t) => {
|
||||
const {srf, disconnect} = require('../app');
|
||||
try {
|
||||
await connect(srf);
|
||||
|
||||
// wait for fs connected to drachtio server.
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
// GIVEN
|
||||
const from = "dial_user";
|
||||
let verbs = [
|
||||
@@ -181,8 +180,6 @@ test('\'dial-user\'', async(t) => {
|
||||
"call_hook": {
|
||||
"url": "http://127.0.0.1:3100/",
|
||||
"method": "POST",
|
||||
"username": "username",
|
||||
"password": "password"
|
||||
},
|
||||
"from": from,
|
||||
"to": {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
require('./unit-tests');
|
||||
require('./docker_start');
|
||||
require('./create-test-db');
|
||||
// require('./account-validation-tests');
|
||||
// require('./dial-tests');
|
||||
// require('./webhooks-tests');
|
||||
// require('./say-tests');
|
||||
// require('./gather-tests');
|
||||
// require('./transcribe-tests');
|
||||
// require('./sip-request-tests');
|
||||
// require('./create-call-test');
|
||||
require('./account-validation-tests');
|
||||
require('./dial-tests');
|
||||
require('./webhooks-tests');
|
||||
require('./say-tests');
|
||||
require('./gather-tests');
|
||||
require('./transcribe-tests');
|
||||
require('./sip-request-tests');
|
||||
require('./create-call-test');
|
||||
require('./play-tests');
|
||||
// require('./sip-refer-tests');
|
||||
// require('./listen-tests');
|
||||
require('./sip-refer-tests');
|
||||
require('./listen-tests');
|
||||
require('./remove-test-db');
|
||||
require('./docker_stop');
|
||||
require('./docker_stop');
|
||||
@@ -223,7 +223,6 @@ test('\'play\' tests with earlymedia', async(t) => {
|
||||
// THEN
|
||||
await sippUac('uac-invite-expect-183-cancel.xml', '172.38.0.10', from);
|
||||
const obj = await getJSON(`http:127.0.0.1:3100/lastRequest/${from}_callStatus`);
|
||||
console.log(obj);
|
||||
t.ok(obj.body.sip_status === 487, "play: actionHook success received");
|
||||
t.ok(obj.body.sip_reason === 'Request Terminated', "play: actionHook success received");
|
||||
t.ok(obj.body.call_termination_by === 'caller', "play: actionHook success received");
|
||||
|
||||
Reference in New Issue
Block a user