[mirotalksfu] - add unit-tests
هذا الالتزام موجود في:
3
.github/workflows/build.yml
مباع
3
.github/workflows/build.yml
مباع
@@ -20,6 +20,9 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
|
- name: Copy config file
|
||||||
|
run: cp app/src/config.template.js app/src/config.js
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,17 @@ const proxyquire = require('proxyquire');
|
|||||||
const jwt = require('jsonwebtoken');
|
const jwt = require('jsonwebtoken');
|
||||||
const CryptoJS = require('crypto-js');
|
const CryptoJS = require('crypto-js');
|
||||||
const ServerApi = require('../app/src/ServerApi');
|
const ServerApi = require('../app/src/ServerApi');
|
||||||
const config = require('../app/src/config.template.js');
|
const config = require('../app/src/config');
|
||||||
|
|
||||||
describe('test-ServerAPI', () => {
|
describe('test-ServerAPI', () => {
|
||||||
let serverApi;
|
let serverApi;
|
||||||
const host = 'example.com';
|
const host = 'example.com';
|
||||||
const authorization = 'mirotalksfu_default_secret';
|
const authorization = 'secret-key';
|
||||||
|
const apiKeySecret = 'secret-key';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
// Mocking config values
|
||||||
|
sinon.stub(config.api, 'keySecret').value(apiKeySecret);
|
||||||
serverApi = new ServerApi(host, authorization);
|
serverApi = new ServerApi(host, authorization);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم