Compare commits

..

1 Commits

Author SHA1 Message Date
367b22bcff Adding a test for HTTP/2
I've never really worked with node before and not sure how to run these
e2e tests, but this is baed on the usage shown on the project's Github

https://github.com/stefanjudis/is-http2
2017-05-03 17:21:34 +00:00
2 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,7 @@
"debug": "^2.2.0",
"dns-sync": "^0.1.3",
"imap": "^0.8.17",
"is-http2": "^1.1.0",
"mkdirp": "^0.5.1",
"mocha": "^2.2.5",
"nodemailer": "^2.4.2",

View File

@ -15,6 +15,7 @@ var AppStore = require('../appstore.js'),
Cloudron = require('../cloudron.js'),
common = require('../common.js'),
digitalocean = require('../digitalocean.js'),
ishttp2 = require('is-http2'),
mailer = require('../mailer.js'),
rimraf = require('rimraf'),
semver = require('semver'),
@ -238,6 +239,19 @@ describe('Selfhost DigitalOcean with filesystem backend', function () {
cloudron.checkAddons(cloudron.appFqdn(location), owner);
});
it('can access app with http2', function () {
ishttp2(cloudron.appFqdn(location), { includeSpdy: true })
.then(function (result) {
assert(result.isHttp2, 'App was not served with HTTP/2');
if (result.supportedProtocols) {
console.log(`Supported protocols: ${ result.supportedProtocols.join(' ') }`);
}
})
.catch(function (error) {
assert(false, 'Could not verify HTTP/2');
});
});
it('can set appstore config', function () {
var token = appStore.getAccessToken(owner);
appStore.setCredentials(owner.password, token);