Небольшие правки. Добавил тесты на новый функционал от crackosok

This commit is contained in:
LightAir
2020-12-01 23:49:41 +03:00
parent 3d5258a6c7
commit 9864d6408a
5 changed files with 33 additions and 8 deletions

View File

@@ -0,0 +1 @@
<rss xmlns:yandex="http://news.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/" xmlns:turbo="http://turbo.yandex.ru" version="2.0"><channel><title><![CDATA[title]]></title><link>http://example.com/rss.xml</link><description><![CDATA[description]]></description><language>ru</language><item turbo="false"><link></link><turbo:content><![CDATA[<header> <h1></h1></header>undefined]]></turbo:content></item></channel></rss>

View File

@@ -1,7 +1,7 @@
// prova is a wrapper for tape
// use npm run test:browser to run tests in a browser
/*
* use npm test to run tests
*/
const test = require('tape');
const TR = require('..');
const includeFolder = require('include-folder');
@@ -31,6 +31,22 @@ test('default item', function (t) {
t.equal(feed.xml(), expectedOutput.defaultItem.trim());
});
test('default item turbo false', function (t) {
t.plan(1);
let feed = new TR({
title: 'title',
description: 'description',
link: 'http://example.com/rss.xml',
site_url: 'http://example.com',
});
feed.item({
turboEnabled: false
});
t.equal(feed.xml(), expectedOutput.defaultItemTurboFalse.trim());
});
test('related item', function (t) {
t.plan(1);
let feed = new TR({