Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies + Formatting + Add Comments #123

Merged
merged 3 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"editor.formatOnSave": true
}
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module.exports = {
verbose: true,
collectCoverage: true,
transform: {
"^.+\\.tsx?$": "ts-jest"
"^.+\\.tsx?$": "ts-jest",
},
testEnvironment: "node",
testPathIgnorePatterns: ["/node_modules/", "__tests__/util/"],
testRegex: "(/__tests__/.*\\.spec)\\.(jsx?|tsx?)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
"@app/(.*)": "<rootDir>/src/$1"
}
"@app/(.*)": "<rootDir>/src/$1",
},
};
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"xml-js": "^1.6.11"
},
"devDependencies": {
"@types/jest": "^24.0.15",
"codeclimate-test-reporter": "^0.5.0",
"coveralls": "^3.0.4",
"jest": "^24.8.0",
"prettier": "^1.18.2",
"@types/jest": "^25.2.3",
"codeclimate-test-reporter": "^0.5.1",
"coveralls": "^3.1.0",
"jest": "^26.0.1",
"prettier": "^2.0.5",
"source-map-loader": "^0.2.4",
"ts-jest": "^24.0.2",
"tslint": "^5.18.0",
"typescript": "^3.5.2"
"ts-jest": "^26.0.0",
"tslint": "^6.1.2",
"typescript": "^3.9.3"
},
"engines": {
"node": ">=0.4.0"
Expand Down
116 changes: 58 additions & 58 deletions src/__tests__/rss2.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sampleFeed, updated, published } from "./setup";
import { Feed } from "../feed";
import { published, sampleFeed, updated } from "./setup";

describe("rss 2.0", () => {
it("should generate a valid feed", () => {
Expand All @@ -17,42 +17,42 @@ describe("rss 2.0", () => {
{
name: "Jane Doe",
email: "janedoe@example.com",
link: "https://example.com/janedoe"
link: "https://example.com/janedoe",
},
{
name: "Joe Smith",
email: "joesmith@example.com",
link: "https://example.com/joesmith"
}
link: "https://example.com/joesmith",
},
],
extensions: [
{
name: "_item_extension_1",
objects: {
about: "just an item extension example",
dummy1: "example"
}
dummy1: "example",
},
},
{
name: "_item_extension_2",
objects: {
about: "just a second item extension example",
dummy1: "example"
}
}
dummy1: "example",
},
},
],
category: [
{
name: 'Grateful Dead'
name: "Grateful Dead",
},
{
name: 'MSFT',
domain: 'http://www.fool.com/cusips'
}
name: "MSFT",
domain: "http://www.fool.com/cusips",
},
],
date: updated,
image: {url: "https://example.com/hello-world.jpg", length: 12665 },
published
image: { url: "https://example.com/hello-world.jpg", length: 12665 },
published,
});
const actual = sampleFeed.rss2();
expect(actual).toMatchSnapshot();
Expand All @@ -68,42 +68,42 @@ describe("rss 2.0", () => {
{
name: "Jane Doe",
email: "janedoe@example.com",
link: "https://example.com/janedoe"
link: "https://example.com/janedoe",
},
{
name: "Joe Smith",
email: "joesmith@example.com",
link: "https://example.com/joesmith"
}
link: "https://example.com/joesmith",
},
],
extensions: [
{
name: "_item_extension_1",
objects: {
about: "just an item extension example",
dummy1: "example"
}
dummy1: "example",
},
},
{
name: "_item_extension_2",
objects: {
about: "just a second item extension example",
dummy1: "example"
}
}
dummy1: "example",
},
},
],
category: [
{
name: 'Grateful Dead'
name: "Grateful Dead",
},
{
name: 'MSFT',
domain: 'http://www.fool.com/cusips'
}
name: "MSFT",
domain: "http://www.fool.com/cusips",
},
],
date: updated,
enclosure: {url: "https://example.com/hello-world.jpg", length: 12665 },
published
enclosure: { url: "https://example.com/hello-world.jpg", length: 12665 },
published,
});
const actual = sampleFeed.rss2();
expect(actual).toMatchSnapshot();
Expand All @@ -118,42 +118,42 @@ describe("rss 2.0", () => {
{
name: "Jane Doe",
email: "janedoe@example.com",
link: "https://example.com/janedoe"
link: "https://example.com/janedoe",
},
{
name: "Joe Smith",
email: "joesmith@example.com",
link: "https://example.com/joesmith"
}
link: "https://example.com/joesmith",
},
],
extensions: [
{
name: "_item_extension_1",
objects: {
about: "just an item extension example",
dummy1: "example"
}
dummy1: "example",
},
},
{
name: "_item_extension_2",
objects: {
about: "just a second item extension example",
dummy1: "example"
}
}
dummy1: "example",
},
},
],
category: [
{
name: 'Grateful Dead'
name: "Grateful Dead",
},
{
name: 'MSFT',
domain: 'http://www.fool.com/cusips'
}
name: "MSFT",
domain: "http://www.fool.com/cusips",
},
],
date: updated,
audio: {url: "https://example.com/hello-world.mp3", length: 12665, type: "audio/mpeg" },
published
audio: { url: "https://example.com/hello-world.mp3", length: 12665, type: "audio/mpeg" },
published,
});
const actual = sampleFeed.rss2();
expect(actual).toMatchSnapshot();
Expand All @@ -174,8 +174,8 @@ describe("rss 2.0", () => {
author: {
name: "John Doe",
email: "johndoe@example.com",
link: "https://example.com/johndoe"
}
link: "https://example.com/johndoe",
},
});
sampleFeed.addItem({
title: "Hello World",
Expand All @@ -187,42 +187,42 @@ describe("rss 2.0", () => {
{
name: "Jane Doe",
email: "janedoe@example.com",
link: "https://example.com/janedoe"
link: "https://example.com/janedoe",
},
{
name: "Joe Smith",
email: "joesmith@example.com",
link: "https://example.com/joesmith"
}
link: "https://example.com/joesmith",
},
],
extensions: [
{
name: "_item_extension_1",
objects: {
about: "just an item extension example",
dummy1: "example"
}
dummy1: "example",
},
},
{
name: "_item_extension_2",
objects: {
about: "just a second item extension example",
dummy1: "example"
}
}
dummy1: "example",
},
},
],
category: [
{
name: 'Grateful Dead'
name: "Grateful Dead",
},
{
name: 'MSFT',
domain: 'http://www.fool.com/cusips'
}
name: "MSFT",
domain: "http://www.fool.com/cusips",
},
],
date: updated,
video: "https://example.com/hello-world.mp4",
published
published,
});
const actual = sampleFeed.rss2();
expect(actual).toMatchSnapshot();
Expand Down
44 changes: 22 additions & 22 deletions src/__tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export const sampleFeed = new Feed({
author: {
name: "John Doe",
email: "johndoe@example.com",
link: "https://example.com/johndoe"
}
link: "https://example.com/johndoe",
},
});

sampleFeed.addCategory("Technology");

sampleFeed.addContributor({
name: "Johan Cruyff",
email: "johancruyff@example.com",
link: "https://example.com/johancruyff"
link: "https://example.com/johancruyff",
});

sampleFeed.addItem({
Expand All @@ -41,61 +41,61 @@ sampleFeed.addItem({
{
name: "Jane Doe",
email: "janedoe@example.com",
link: "https://example.com/janedoe"
link: "https://example.com/janedoe",
},
{
name: "Joe Smith",
email: "joesmith@example.com",
link: "https://example.com/joesmith"
}
link: "https://example.com/joesmith",
},
],
contributor: [
{
name: "Shawn Kemp",
email: "shawnkemp@example.com",
link: "https://example.com/shawnkemp"
link: "https://example.com/shawnkemp",
},
{
name: "Reggie Miller",
email: "reggiemiller@example.com",
link: "https://example.com/reggiemiller"
}
link: "https://example.com/reggiemiller",
},
],
extensions: [
{
name: "_item_extension_1",
objects: {
about: "just an item extension example",
dummy1: "example"
}
dummy1: "example",
},
},
{
name: "_item_extension_2",
objects: {
about: "just a second item extension example",
dummy1: "example"
}
}
dummy1: "example",
},
},
],
category: [
{
name: 'Grateful Dead'
name: "Grateful Dead",
},
{
name: 'MSFT',
domain: 'http://www.fool.com/cusips'
}
name: "MSFT",
domain: "http://www.fool.com/cusips",
},
],
date: updated,
image: "https://example.com/hello-world.jpg",
enclosure: {url: "https://example.com/hello-world.jpg", length: 12665, type: 'image/jpeg' },
published
enclosure: { url: "https://example.com/hello-world.jpg", length: 12665, type: "image/jpeg" },
published,
});

sampleFeed.addExtension({
name: "_example_extension",
objects: {
about: "just an extension example",
dummy: "example"
}
dummy: "example",
},
});
Loading