mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-05 21:57:31 +09:00
32 lines
657 B
TypeScript
32 lines
657 B
TypeScript
/**
|
|
* Tests!
|
|
*/
|
|
|
|
import * as chai from 'chai';
|
|
import * as express from 'express';
|
|
|
|
import summaly from '../';
|
|
|
|
Error.stackTraceLimit = Infinity;
|
|
|
|
// During the test the env variable is set to test
|
|
process.env.NODE_ENV = 'test';
|
|
|
|
// Display detail of unhandled promise rejection
|
|
process.on('unhandledRejection', console.dir);
|
|
|
|
const should = chai.should();
|
|
|
|
describe('OGP', () => {
|
|
it('title', () => {
|
|
const server = express();
|
|
server.use((req, res) => {
|
|
res.sendFile('./htmls/og-title.html');
|
|
});
|
|
server.listen(0, async () => {
|
|
const summary = await summaly('localhost:0');
|
|
should.equal(summary.title, 'KISS principle');
|
|
});
|
|
});
|
|
});
|