2021-02-19 10:05:52 +03:00
|
|
|
var request = require('supertest');
|
2022-11-30 02:49:08 +03:00
|
|
|
|
|
|
|
const Random = require('crypto-random');
|
|
|
|
|
|
|
|
const sendConfigChangeRequest = require('./lib/admin').sendConfigChangeRequest;
|
|
|
|
const getAdminConfig = require('./lib/admin').getAdminConfig;
|
|
|
|
const getAdminStatus = require('./lib/admin').getAdminStatus;
|
|
|
|
|
2021-02-19 10:05:52 +03:00
|
|
|
request = request('http://127.0.0.1:8080');
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
|
|
|
|
// initial configuration of server
|
|
|
|
const defaultServerName = 'New Owncast Server';
|
|
|
|
const defaultStreamTitle = undefined;
|
|
|
|
const defaultLogo = '/logo';
|
|
|
|
const defaultOfflineMessage = '';
|
|
|
|
const defaultServerSummary = 'This is a new live video streaming server powered by Owncast.';
|
|
|
|
const defaultAdminPassword = 'abc123';
|
|
|
|
const defaultStreamKeys = [{ key: defaultAdminPassword, comment: 'Default stream key' }];
|
|
|
|
const defaultTags = ["owncast", "streaming"];
|
|
|
|
const defaultYPConfig = {
|
|
|
|
enabled: false,
|
|
|
|
instanceUrl: ""
|
|
|
|
};
|
|
|
|
const defaultS3Config = {
|
|
|
|
enabled: false,
|
|
|
|
forcePathStyle: false
|
|
|
|
};
|
|
|
|
const defaultFederationConfig = {
|
|
|
|
enabled: false,
|
|
|
|
isPrivate: false,
|
|
|
|
showEngagement: true,
|
|
|
|
goLiveMessage: "I've gone live!",
|
|
|
|
username: "streamer",
|
|
|
|
blockedDomains: []
|
|
|
|
};
|
|
|
|
const defaultHideViewerCount = false;
|
|
|
|
const defaultSocialHandles = [{
|
|
|
|
"icon": "/img/platformlogos/github.svg",
|
|
|
|
"platform": "github",
|
|
|
|
"url": "https://github.com/owncast/owncast"
|
|
|
|
}];
|
|
|
|
const defaultSocialHandlesAdmin = [{
|
|
|
|
"platform": "github",
|
|
|
|
"url": "https://github.com/owncast/owncast"
|
|
|
|
}];
|
|
|
|
const defaultForbiddenUsernames = [
|
|
|
|
"owncast",
|
|
|
|
"operator",
|
|
|
|
"admin",
|
|
|
|
"system",
|
|
|
|
];
|
|
|
|
const defaultPageContent = `<h1>Welcome to Owncast!</h1>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<p>This is a live stream powered by <a href="https://owncast.online">Owncast</a>, a free and open source live streaming server.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>To discover more examples of streams, visit <a href="https://directory.owncast.online">Owncast's directory</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If you're the owner of this server you should visit the admin and customize the content on this page.</p>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<hr/>
|
|
|
|
<video id="video" controls preload="metadata" width="40%" poster="https://videos.owncast.online/t/xaJ3xNn9Y6pWTdB25m9ai3">
|
|
|
|
<source src="https://videos.owncast.online/v/xaJ3xNn9Y6pWTdB25m9ai3.mp4?quality=" type="video/mp4" />
|
|
|
|
</video>`;
|
|
|
|
|
|
|
|
// new configuration for testing
|
|
|
|
const newServerName = randomString();
|
|
|
|
const newStreamTitle = randomString();
|
|
|
|
const newServerSummary = randomString();
|
|
|
|
const newOfflineMessage = randomString();
|
|
|
|
const newPageContent = `<p>${randomString()}</p>`;
|
|
|
|
const newTags = [randomString(), randomString(), randomString()];
|
|
|
|
const newStreamKeys = [
|
2022-11-24 03:39:55 +03:00
|
|
|
{ key: randomString(), comment: 'test key 1' },
|
2022-11-30 02:49:08 +03:00
|
|
|
{ key: randomString(), comment: 'test key 2' },
|
|
|
|
{ key: randomString(), comment: 'test key 3' },
|
2022-11-24 03:39:55 +03:00
|
|
|
];
|
2022-11-30 02:49:08 +03:00
|
|
|
const newAdminPassword = randomString();
|
2022-11-23 09:08:25 +03:00
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
const latencyLevel = Random.range(0, 4);
|
2022-11-13 07:26:55 +03:00
|
|
|
const appearanceValues = {
|
|
|
|
variable1: randomString(),
|
|
|
|
variable2: randomString(),
|
|
|
|
variable3: randomString(),
|
|
|
|
};
|
2021-02-19 10:05:52 +03:00
|
|
|
|
|
|
|
const streamOutputVariants = {
|
2022-06-26 10:46:55 +03:00
|
|
|
videoBitrate: randomNumber() * 100,
|
|
|
|
framerate: 42,
|
|
|
|
cpuUsageLevel: 2,
|
|
|
|
scaledHeight: randomNumber() * 100,
|
|
|
|
scaledWidth: randomNumber() * 100,
|
2021-02-19 10:05:52 +03:00
|
|
|
};
|
2022-11-30 02:49:08 +03:00
|
|
|
const newSocialHandles = [
|
2022-06-26 10:46:55 +03:00
|
|
|
{
|
|
|
|
url: 'http://facebook.org/' + randomString(),
|
|
|
|
platform: randomString(),
|
|
|
|
},
|
2021-02-19 10:05:52 +03:00
|
|
|
];
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
const newS3Config = {
|
|
|
|
enabled: !defaultS3Config.enabled,
|
|
|
|
endpoint: 'http://' + randomString() + ".tld",
|
2022-06-26 10:46:55 +03:00
|
|
|
accessKey: randomString(),
|
|
|
|
secret: randomString(),
|
|
|
|
bucket: randomString(),
|
|
|
|
region: randomString(),
|
2022-11-30 02:49:08 +03:00
|
|
|
forcePathStyle: !defaultS3Config.forcePathStyle,
|
2021-02-19 10:05:52 +03:00
|
|
|
};
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
const newForbiddenUsernames = [randomString(), randomString(), randomString()];
|
|
|
|
|
|
|
|
const newYPConfig = {
|
|
|
|
enabled: !defaultYPConfig.enabled,
|
|
|
|
instanceUrl: 'http://' + randomString() + ".tld"
|
|
|
|
};
|
|
|
|
|
|
|
|
const newFederationConfig = {
|
|
|
|
enabled: !defaultFederationConfig.enabled,
|
|
|
|
isPrivate: !defaultFederationConfig.isPrivate,
|
|
|
|
username: randomString(),
|
|
|
|
goLiveMessage: randomString(),
|
|
|
|
showEngagement: !defaultFederationConfig.showEngagement,
|
|
|
|
blockedDomains: [randomString() + ".tld", randomString() + ".tld"],
|
|
|
|
};
|
|
|
|
|
|
|
|
const newHideViewerCount = !defaultHideViewerCount;
|
|
|
|
|
|
|
|
|
|
|
|
test('verify default config values', async (done) => {
|
|
|
|
const res = await request.get('/api/config');
|
|
|
|
expect(res.body.name).toBe(defaultServerName);
|
|
|
|
expect(res.body.streamTitle).toBe(defaultStreamTitle);
|
|
|
|
expect(res.body.summary).toBe(`${defaultServerSummary}`);
|
|
|
|
expect(res.body.extraPageContent).toBe(defaultPageContent);
|
|
|
|
expect(res.body.offlineMessage).toBe(defaultOfflineMessage);
|
|
|
|
expect(res.body.logo).toBe(defaultLogo);
|
|
|
|
expect(res.body.socialHandles).toStrictEqual(defaultSocialHandles);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('verify default admin configuration', async (done) => {
|
|
|
|
const res = await getAdminConfig();
|
|
|
|
|
|
|
|
expect(res.body.instanceDetails.name).toBe(defaultServerName);
|
|
|
|
expect(res.body.instanceDetails.summary).toBe(defaultServerSummary);
|
|
|
|
expect(res.body.instanceDetails.offlineMessage).toBe(defaultOfflineMessage);
|
|
|
|
expect(res.body.instanceDetails.tags).toStrictEqual(defaultTags);
|
|
|
|
expect(res.body.instanceDetails.socialHandles).toStrictEqual(
|
|
|
|
defaultSocialHandlesAdmin
|
|
|
|
);
|
|
|
|
expect(res.body.forbiddenUsernames).toStrictEqual(defaultForbiddenUsernames);
|
|
|
|
expect(res.body.streamKeys).toStrictEqual(defaultStreamKeys);
|
|
|
|
|
|
|
|
expect(res.body.yp.enabled).toBe(defaultYPConfig.enabled);
|
|
|
|
expect(res.body.yp.instanceUrl).toBe(defaultYPConfig.instanceUrl);
|
|
|
|
|
|
|
|
expect(res.body.adminPassword).toBe(defaultAdminPassword);
|
|
|
|
|
|
|
|
expect(res.body.s3.enabled).toBe(defaultS3Config.enabled);
|
|
|
|
expect(res.body.s3.forcePathStyle).toBe(defaultS3Config.forcePathStyle);
|
|
|
|
expect(res.body.hideViewerCount).toBe(defaultHideViewerCount);
|
|
|
|
|
|
|
|
expect(res.body.federation.enabled).toBe(defaultFederationConfig.enabled);
|
|
|
|
expect(res.body.federation.username).toBe(defaultFederationConfig.username);
|
|
|
|
expect(res.body.federation.isPrivate).toBe(defaultFederationConfig.isPrivate);
|
|
|
|
expect(res.body.federation.showEngagement).toBe(defaultFederationConfig.showEngagement);
|
|
|
|
expect(res.body.federation.goLiveMessage).toBe(defaultFederationConfig.goLiveMessage);
|
|
|
|
expect(res.body.federation.blockedDomains).toStrictEqual(defaultFederationConfig.blockedDomains);
|
|
|
|
done();
|
|
|
|
|
|
|
|
});
|
2021-07-20 05:22:29 +03:00
|
|
|
|
2021-02-19 10:05:52 +03:00
|
|
|
test('set server name', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('name', newServerName);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set stream title', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('streamtitle', newStreamTitle);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set server summary', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('serversummary', newServerSummary);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set extra page content', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('pagecontent', newPageContent);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set tags', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('tags', newTags);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
2022-11-23 09:08:25 +03:00
|
|
|
test('set stream keys', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('streamkeys', newStreamKeys);
|
2022-11-23 09:08:25 +03:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
2021-02-19 10:05:52 +03:00
|
|
|
test('set latency level', async (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
const res = await sendConfigChangeRequest(
|
|
|
|
'video/streamlatencylevel',
|
|
|
|
latencyLevel
|
|
|
|
);
|
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set video stream output variants', async (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
const res = await sendConfigChangeRequest('video/streamoutputvariants', [
|
|
|
|
streamOutputVariants,
|
|
|
|
]);
|
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set social handles', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('socialhandles', newSocialHandles);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('set s3 configuration', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('s3', newS3Config);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
2021-07-20 05:22:29 +03:00
|
|
|
test('set forbidden usernames', async (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
const res = await sendConfigChangeRequest(
|
|
|
|
'chat/forbiddenusernames',
|
2022-11-30 02:49:08 +03:00
|
|
|
newForbiddenUsernames
|
2022-06-26 10:46:55 +03:00
|
|
|
);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
test('set server url', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('serverurl', newYPConfig.instanceUrl);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('set federation username', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/username', newFederationConfig.username);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('set federation goLiveMessage', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/livemessage', newFederationConfig.goLiveMessage);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('toggle private federation mode', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/private', newFederationConfig.isPrivate);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('toggle federation engagement', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/showengagement', newFederationConfig.showEngagement);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('set federation blocked domains', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/blockdomains', newFederationConfig.blockedDomains);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-07-20 05:22:29 +03:00
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
|
2022-08-10 08:09:43 +03:00
|
|
|
test('set offline message', async (done) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
const res = await sendConfigChangeRequest('offlinemessage', newOfflineMessage);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('set hide viewer count', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('hideviewercount', newHideViewerCount);
|
2022-08-10 08:09:43 +03:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
2022-11-13 07:26:55 +03:00
|
|
|
test('set custom style values', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('appearance', appearanceValues);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
test('enable directory', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('directoryenabled', true);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('enable federation', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('federation/enable', newFederationConfig.enabled);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('change admin password', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('adminpass', newAdminPassword);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('verify admin password change', async (done) => {
|
|
|
|
const res = await getAdminConfig(adminPassword = newAdminPassword);
|
|
|
|
|
|
|
|
expect(res.body.adminPassword).toBe(newAdminPassword);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('reset admin password', async (done) => {
|
|
|
|
const res = await sendConfigChangeRequest('adminpass', defaultAdminPassword, adminPassword = newAdminPassword);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
2021-02-19 10:05:52 +03:00
|
|
|
test('verify updated config values', async (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
const res = await request.get('/api/config');
|
2022-11-30 02:49:08 +03:00
|
|
|
expect(res.body.name).toBe(newServerName);
|
|
|
|
expect(res.body.streamTitle).toBe(newStreamTitle);
|
|
|
|
expect(res.body.summary).toBe(`${newServerSummary}`);
|
|
|
|
expect(res.body.extraPageContent).toBe(newPageContent);
|
|
|
|
expect(res.body.offlineMessage).toBe(newOfflineMessage);
|
2022-06-26 10:46:55 +03:00
|
|
|
expect(res.body.logo).toBe('/logo');
|
2022-11-30 02:49:08 +03:00
|
|
|
expect(res.body.socialHandles).toStrictEqual(newSocialHandles);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
// Test that the raw video details being broadcasted are coming through
|
2022-11-30 02:49:08 +03:00
|
|
|
test('verify admin stream details', async (done) => {
|
|
|
|
const res = await getAdminStatus();
|
|
|
|
|
|
|
|
expect(res.body.broadcaster.streamDetails.width).toBe(320);
|
|
|
|
expect(res.body.broadcaster.streamDetails.height).toBe(180);
|
|
|
|
expect(res.body.broadcaster.streamDetails.framerate).toBe(24);
|
|
|
|
expect(res.body.broadcaster.streamDetails.videoBitrate).toBe(1269);
|
|
|
|
expect(res.body.broadcaster.streamDetails.videoCodec).toBe('H.264');
|
|
|
|
expect(res.body.broadcaster.streamDetails.audioCodec).toBe('AAC');
|
|
|
|
expect(res.body.online).toBe(true);
|
|
|
|
done();
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
test('verify updated admin configuration', async (done) => {
|
|
|
|
const res = await getAdminConfig();
|
|
|
|
|
|
|
|
expect(res.body.instanceDetails.name).toBe(newServerName);
|
|
|
|
expect(res.body.instanceDetails.summary).toBe(newServerSummary);
|
|
|
|
expect(res.body.instanceDetails.offlineMessage).toBe(newOfflineMessage);
|
|
|
|
expect(res.body.instanceDetails.tags).toStrictEqual(newTags);
|
|
|
|
expect(res.body.instanceDetails.socialHandles).toStrictEqual(
|
|
|
|
newSocialHandles
|
|
|
|
);
|
|
|
|
expect(res.body.forbiddenUsernames).toStrictEqual(newForbiddenUsernames);
|
|
|
|
expect(res.body.streamKeys).toStrictEqual(newStreamKeys);
|
|
|
|
|
|
|
|
expect(res.body.videoSettings.latencyLevel).toBe(latencyLevel);
|
|
|
|
expect(res.body.videoSettings.videoQualityVariants[0].framerate).toBe(
|
|
|
|
streamOutputVariants.framerate
|
|
|
|
);
|
|
|
|
expect(res.body.videoSettings.videoQualityVariants[0].cpuUsageLevel).toBe(
|
|
|
|
streamOutputVariants.cpuUsageLevel
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(res.body.yp.enabled).toBe(newYPConfig.enabled);
|
|
|
|
expect(res.body.yp.instanceUrl).toBe(newYPConfig.instanceUrl);
|
|
|
|
|
|
|
|
expect(res.body.adminPassword).toBe(defaultAdminPassword);
|
|
|
|
|
|
|
|
expect(res.body.s3.enabled).toBe(newS3Config.enabled);
|
|
|
|
expect(res.body.s3.endpoint).toBe(newS3Config.endpoint);
|
|
|
|
expect(res.body.s3.accessKey).toBe(newS3Config.accessKey);
|
|
|
|
expect(res.body.s3.secret).toBe(newS3Config.secret);
|
|
|
|
expect(res.body.s3.bucket).toBe(newS3Config.bucket);
|
|
|
|
expect(res.body.s3.region).toBe(newS3Config.region);
|
|
|
|
expect(res.body.s3.forcePathStyle).toBe(newS3Config.forcePathStyle);
|
|
|
|
expect(res.body.hideViewerCount).toBe(newHideViewerCount);
|
|
|
|
|
|
|
|
expect(res.body.federation.enabled).toBe(newFederationConfig.enabled);
|
|
|
|
expect(res.body.federation.isPrivate).toBe(newFederationConfig.isPrivate);
|
|
|
|
expect(res.body.federation.username).toBe(newFederationConfig.username);
|
|
|
|
expect(res.body.federation.goLiveMessage).toBe(newFederationConfig.goLiveMessage);
|
|
|
|
expect(res.body.federation.showEngagement).toBe(newFederationConfig.showEngagement);
|
|
|
|
expect(res.body.federation.blockedDomains).toStrictEqual(newFederationConfig.blockedDomains);
|
|
|
|
done();
|
|
|
|
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
test('verify updated frontend configuration', (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
request
|
|
|
|
.get('/api/config')
|
|
|
|
.expect(200)
|
|
|
|
.then((res) => {
|
2022-11-30 02:49:08 +03:00
|
|
|
expect(res.body.name).toBe(newServerName);
|
2022-06-26 10:46:55 +03:00
|
|
|
expect(res.body.logo).toBe('/logo');
|
2022-11-30 02:49:08 +03:00
|
|
|
expect(res.body.socialHandles).toStrictEqual(newSocialHandles);
|
2022-06-26 10:46:55 +03:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-11-30 02:49:08 +03:00
|
|
|
test('verify frontend status', (done) => {
|
2022-06-26 10:46:55 +03:00
|
|
|
request
|
|
|
|
.get('/api/status')
|
|
|
|
.expect(200)
|
|
|
|
.then((res) => {
|
|
|
|
expect(res.body.viewerCount).toBe(undefined);
|
|
|
|
done();
|
|
|
|
});
|
2021-02-19 10:05:52 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function randomString(length = 20) {
|
2022-11-30 02:49:08 +03:00
|
|
|
return Random.value().toString(16).substr(2, length);
|
2021-02-19 10:05:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function randomNumber() {
|
2022-11-30 02:49:08 +03:00
|
|
|
return Random.range(0, 5);
|
2021-02-19 10:05:52 +03:00
|
|
|
}
|