From 367b22bcff839ab64ebfba73e482539e26e2b638 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 3 May 2017 17:21:34 +0000 Subject: [PATCH] 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 --- package.json | 1 + test/selfhost-digitalocean-filesystem-test.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/package.json b/package.json index 98a37a8..74e96ef 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/selfhost-digitalocean-filesystem-test.js b/test/selfhost-digitalocean-filesystem-test.js index 6383186..4a36c83 100644 --- a/test/selfhost-digitalocean-filesystem-test.js +++ b/test/selfhost-digitalocean-filesystem-test.js @@ -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);