[Test] いい感じにした

This commit is contained in:
syuilo 2017-02-08 17:27:16 +09:00
parent 7e3c650df2
commit c0c51027d1
2 changed files with 18 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta property="og:description" content="KISS is an acronym for 'Keep it simple, stupid' as a design principle noted by the U.S. Navy in 1960.">
<meta property="og:description" content="Strawberry Pasta">
<title>YEE HAW</title>
</head>
<body>

View File

@ -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();
});
});