mirror of
https://github.com/LightAir/turbo-rss.git
synced 2026-02-04 03:56:19 +00:00
Небольшие правки. Добавил тесты на новый функционал от crackosok
This commit is contained in:
1
test/expectedOutput/defaultItemTurboFalse.xml
Normal file
1
test/expectedOutput/defaultItemTurboFalse.xml
Normal 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>
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user