From 9880b415debc8bfb873fd6d0a7f49703187cf303 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 8 Feb 2017 17:41:49 +0900 Subject: [PATCH] [Test] Add the og:image test --- test/htmls/og-image.html | 13 +++++++++++++ test/index.js | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/htmls/og-image.html diff --git a/test/htmls/og-image.html b/test/htmls/og-image.html new file mode 100644 index 0000000..3c380d7 --- /dev/null +++ b/test/htmls/og-image.html @@ -0,0 +1,13 @@ + + + + + + + YEE HAW + + +

Yo

+

Hey hey hey syuilo.

+ + diff --git a/test/index.js b/test/index.js index b251395..c3f3989 100644 --- a/test/index.js +++ b/test/index.js @@ -48,4 +48,17 @@ describe('OGP', () => { done(); }); }); + + it('thumbnail', done => { + const app = express(); + app.use((req, res) => { + res.sendFile(__dirname + '/htmls/og-image.html'); + }); + const server = app.listen(80, async () => { + const summary = await summaly('http://localhost'); + assert.equal(summary.thumbnail, 'https://himasaku.net/himasaku.png'); + server.close(); + done(); + }); + }); });