Skip to content
Permalink
Browse files

Refactor tests

  • Loading branch information...
jpmonette committed Aug 4, 2018
1 parent 1db9cf4 commit d6a37360293b08de32b5ba498e9b3de27c42799d
@@ -6,7 +6,7 @@ module.exports = {
},
testEnvironment: "node",
testPathIgnorePatterns: ["/node_modules/", "__tests__/util/"],
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
testRegex: "(/__tests__/.*\\.spec)\\.(jsx?|tsx?)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
"@app/(.*)": "<rootDir>/src/$1"
@@ -0,0 +1,115 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`atom 1.0 should generate a valid feed - legacy 1`] = `
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<feed xmlns=\\"http://www.w3.org/2005/Atom\\">
<id>http://example.com/</id>
<title>Feed Title</title>
<updated>2013-07-13T23:00:00.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<author>
<name>John Doe</name>
<email>johndoe@example.com</email>
<uri>https://example.com/johndoe</uri>
</author>
<link rel=\\"alternate\\" href=\\"http://example.com/\\"/>
<link rel=\\"self\\" href=\\"http://example.com/sampleFeed.rss\\"/>
<subtitle>This is my personnal feed!</subtitle>
<logo>http://example.com/image.png</logo>
<rights>All rights reserved 2013, John Doe</rights>
<category term=\\"Technology\\">
</category>
<contributor>
<name>Johan Cruyff</name>
<email>johancruyff@example.com</email>
<uri>https://example.com/johancruyff</uri>
</contributor>
<entry>
<title type=\\"html\\"><![CDATA[Hello World]]></title>
<id>https://example.com/hello-world</id>
<link href=\\"https://example.com/hello-world\\">
</link>
<updated>2013-07-13T23:00:00.000Z</updated>
<summary type=\\"html\\"><![CDATA[This is an article about Hello World.]]></summary>
<content type=\\"html\\"><![CDATA[Content of my item]]></content>
<author>
<name>Jane Doe</name>
<email>janedoe@example.com</email>
<uri>https://example.com/janedoe</uri>
</author>
<author>
<name>Joe Smith</name>
<email>joesmith@example.com</email>
<uri>https://example.com/joesmith</uri>
</author>
<contributor>
<name>Shawn Kemp</name>
<email>shawnkemp@example.com</email>
<uri>https://example.com/shawnkemp</uri>
</contributor>
<contributor>
<name>Reggie Miller</name>
<email>reggiemiller@example.com</email>
<uri>https://example.com/reggiemiller</uri>
</contributor>
<published>2013-07-10T23:00:00.000Z</published>
</entry>
</feed>"
`;

exports[`atom 1.0 should generate a valid feed 1`] = `
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<feed xmlns=\\"http://www.w3.org/2005/Atom\\">
<id>http://example.com/</id>
<title>Feed Title</title>
<updated>2013-07-13T23:00:00.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<author>
<name>John Doe</name>
<email>johndoe@example.com</email>
<uri>https://example.com/johndoe</uri>
</author>
<link rel=\\"alternate\\" href=\\"http://example.com/\\"/>
<link rel=\\"self\\" href=\\"http://example.com/sampleFeed.rss\\"/>
<subtitle>This is my personnal feed!</subtitle>
<logo>http://example.com/image.png</logo>
<rights>All rights reserved 2013, John Doe</rights>
<category term=\\"Technology\\">
</category>
<contributor>
<name>Johan Cruyff</name>
<email>johancruyff@example.com</email>
<uri>https://example.com/johancruyff</uri>
</contributor>
<entry>
<title type=\\"html\\"><![CDATA[Hello World]]></title>
<id>https://example.com/hello-world</id>
<link href=\\"https://example.com/hello-world\\">
</link>
<updated>2013-07-13T23:00:00.000Z</updated>
<summary type=\\"html\\"><![CDATA[This is an article about Hello World.]]></summary>
<content type=\\"html\\"><![CDATA[Content of my item]]></content>
<author>
<name>Jane Doe</name>
<email>janedoe@example.com</email>
<uri>https://example.com/janedoe</uri>
</author>
<author>
<name>Joe Smith</name>
<email>joesmith@example.com</email>
<uri>https://example.com/joesmith</uri>
</author>
<contributor>
<name>Shawn Kemp</name>
<email>shawnkemp@example.com</email>
<uri>https://example.com/shawnkemp</uri>
</contributor>
<contributor>
<name>Reggie Miller</name>
<email>reggiemiller@example.com</email>
<uri>https://example.com/reggiemiller</uri>
</contributor>
<published>2013-07-10T23:00:00.000Z</published>
</entry>
</feed>"
`;

This file was deleted.

@@ -0,0 +1,43 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`json 1 should generate a valid feed 1`] = `
"{
\\"version\\": \\"https://jsonfeed.org/version/1\\",
\\"title\\": \\"Feed Title\\",
\\"home_page_url\\": \\"http://example.com/\\",
\\"description\\": \\"This is my personnal feed!\\",
\\"icon\\": \\"http://example.com/image.png\\",
\\"author\\": {
\\"name\\": \\"John Doe\\",
\\"url\\": \\"https://example.com/johndoe\\"
},
\\"_example_extension\\": {
\\"about\\": \\"just an extension example\\",
\\"dummy\\": \\"example\\"
},
\\"items\\": [
{
\\"id\\": \\"https://example.com/hello-world\\",
\\"html_content\\": \\"Content of my item\\",
\\"url\\": \\"https://example.com/hello-world\\",
\\"title\\": \\"Hello World\\",
\\"summary\\": \\"This is an article about Hello World.\\",
\\"image\\": \\"https://example.com/hello-world.jpg\\",
\\"date_modified\\": \\"2013-07-13T23:00:00.000Z\\",
\\"date_published\\": \\"2013-07-10T23:00:00.000Z\\",
\\"author\\": {
\\"name\\": \\"Jane Doe\\",
\\"url\\": \\"https://example.com/janedoe\\"
},
\\"_item_extension_1\\": {
\\"about\\": \\"just an item extension example\\",
\\"dummy1\\": \\"example\\"
},
\\"_item_extension_2\\": {
\\"about\\": \\"just a second item extension example\\",
\\"dummy1\\": \\"example\\"
}
}
]
}"
`;

0 comments on commit d6a3736

Please sign in to comment.
You can’t perform that action at this time.