Skip to content

Commit 48c7925

Browse files
committed
add instant article test case
1 parent 0c26a0c commit 48c7925

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

test/input/instant-article.rss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
3+
<channel>
4+
<title>Instant Article Test</title>
5+
<link>https://localhost:8000</link>
6+
<description>1, 2, 1, 2… check the mic!</description>
7+
<language>en</language>
8+
<pubDate>Fri, 13 May 2016 15:14:05 GMT</pubDate>
9+
<dc:date>2016-05-13T15:14:05Z</dc:date>
10+
<dc:language>en</dc:language>
11+
<item>
12+
<title>My first Instant Article</title>
13+
<link>https://localhost:8000</link>
14+
<description>Lorem ipsum</description>
15+
<content:encoded>&lt;b&gt;Lorem&lt;/b&gt; ipsum</content:encoded>
16+
<pubDate>Wed, 04 May 2016 06:53:45 GMT</pubDate>
17+
<guid>https://localhost:8000</guid>
18+
<dc:creator>tobi</dc:creator>
19+
<dc:date>2016-05-04T06:53:45Z</dc:date>
20+
</item>
21+
</channel>
22+
</rss>

test/output/instant-article.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"feed": {
3+
"entries": [
4+
{
5+
"title": "My first Instant Article",
6+
"link": "https://localhost:8000",
7+
"pubDate": "Wed, 04 May 2016 06:53:45 GMT",
8+
"content:encoded": "<b>Lorem</b> ipsum",
9+
"content": "Lorem ipsum",
10+
"contentSnippet": "Lorem ipsum",
11+
"guid": "https://localhost:8000"
12+
}
13+
],
14+
"title": "Instant Article Test",
15+
"description": "1, 2, 1, 2… check the mic!",
16+
"link": "https://localhost:8000"
17+
}
18+
}

test/parser.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,8 @@ describe('Parser', function() {
5555
it('should parse heise', function(done) {
5656
testParseForFile('heise', 'atom', done);
5757
})
58+
59+
it('should parse Instant Article', function(done) {
60+
testParseForFile('instant-article', 'rss', done);
61+
})
5862
})

0 commit comments

Comments
 (0)