owncast/test/automated/index.test.js
Gabe Kangas 5dff6f32fc
End to end automated tests run on Github workflows (#384)
* WIP for automated integration test

* See if it runs under a workflow

* Support running test locally as well as a workflow

* Use already downloaded repo to build. Do not re-clone

* Add comments

* Update to support new default config file

* Split out different test suites

* Add test for chat

* Always run test with config-default and ignore local config file

* Remove the build workflow because the end to end test does that now
2020-11-24 00:28:54 -08:00

22 lines
703 B
JavaScript

var request = require('supertest');
request = request('http://127.0.0.1:8080');
test('service is online', (done) => {
request.get('/api/status').expect(200)
.then((res) => {
expect(res.body.online).toBe(true);
done();
});
});
test('frontend configuration is correct', (done) => {
request.get('/api/config').expect(200)
.then((res) => {
expect(res.body.title).toBe('Owncast');
expect(res.body.logo).toBe('/img/logo.svg');
expect(res.body.socialHandles[0].platform).toBe('github');
expect(res.body.socialHandles[0].url).toBe('http://github.com/owncast/owncast');
done();
});
});