diff --git a/test/htmls/og-description.html b/test/htmls/og-description.html index f8afda6..e036893 100644 --- a/test/htmls/og-description.html +++ b/test/htmls/og-description.html @@ -3,7 +3,7 @@ - + YEE HAW diff --git a/test/index.js b/test/index.js index 67c77d0..b251395 100644 --- a/test/index.js +++ b/test/index.js @@ -24,13 +24,27 @@ process.on('unhandledRejection', console.dir); describe('OGP', () => { it('title', done => { - const server = express(); - server.use((req, res) => { + const app = express(); + app.use((req, res) => { res.sendFile(__dirname + '/htmls/og-title.html'); }); - server.listen(80, async () => { + const server = app.listen(80, async () => { const summary = await summaly('http://localhost'); assert.equal(summary.title, 'Strawberry Pasta'); + server.close(); + done(); + }); + }); + + it('description', done => { + const app = express(); + app.use((req, res) => { + res.sendFile(__dirname + '/htmls/og-description.html'); + }); + const server = app.listen(80, async () => { + const summary = await summaly('http://localhost'); + assert.equal(summary.description, 'Strawberry Pasta'); + server.close(); done(); }); });