You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mercury-parser/src/extractors/custom/nymag.com/index.test.js

19 lines
668 B
JavaScript

8 years ago
import assert from 'assert';
import fs from 'fs';
import Mercury from 'mercury';
describe('NYMagExtractor', () => {
8 years ago
it('works with a feature story', (async) () => {
const html = fs.readFileSync('./fixtures/nymag.com/ailes.html');
const uri = 'http://nymag.com/daily/intelligencer/2016/09/how-fox-news-women-took-down-roger-ailes.html';
const { dek, title, author } = await Mercury.parse(uri, html);
8 years ago
const actualDek = 'How Fox News women took down the most powerful, and predatory, man in media.';
8 years ago
assert.equal(dek, actualDek);
assert.equal(title, 'The Revenge of Rogers Angels');
assert.equal(author, 'Gabriel Sherman');
});
});