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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import assert from 'assert';
import fs from 'fs';
import Mercury from 'mercury';
describe('NYMagExtractor', () => {
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);
const actualDek = 'How Fox News women took down the most powerful, and predatory, man in media.';
assert.equal(dek, actualDek);
assert.equal(title, 'The Revenge of Rogers Angels');
assert.equal(author, 'Gabriel Sherman');
});
});