From 3ec5546359239f66714ae6eb5257810877202a52 Mon Sep 17 00:00:00 2001 From: Andres Rey Date: Wed, 7 Dec 2016 09:59:02 +0000 Subject: Added some basic Unit Testing. HTML samples taken from readability.js --- test/test-pages/webmd-1/expected-metadata.json | 6 + test/test-pages/webmd-1/expected.html | 17 + test/test-pages/webmd-1/source.html | 2411 ++++++++++++++++++++++++ 3 files changed, 2434 insertions(+) create mode 100644 test/test-pages/webmd-1/expected-metadata.json create mode 100644 test/test-pages/webmd-1/expected.html create mode 100644 test/test-pages/webmd-1/source.html (limited to 'test/test-pages/webmd-1') diff --git a/test/test-pages/webmd-1/expected-metadata.json b/test/test-pages/webmd-1/expected-metadata.json new file mode 100644 index 0000000..4ceddcf --- /dev/null +++ b/test/test-pages/webmd-1/expected-metadata.json @@ -0,0 +1,6 @@ +{ + "title": "Babies Who Eat Peanuts Early May Avoid Allergy", + "byline": "By Brenda Goodman, MA\n WebMD Health News", + "excerpt": "Life-threatening peanut allergies have mysteriously been on the rise in the past decade, with little hope for a cure. But a groundbreaking new study may offer a way to stem that rise, while another may offer some hope for those who are already allergic.", + "readerable": true +} diff --git a/test/test-pages/webmd-1/expected.html b/test/test-pages/webmd-1/expected.html new file mode 100644 index 0000000..54d6db4 --- /dev/null +++ b/test/test-pages/webmd-1/expected.html @@ -0,0 +1,17 @@ +
+
+

+

Feb. 23, 2015 -- Life-threatening peanut allergies have mysteriously been on the rise in the past decade, with little hope for a cure.

+

But a groundbreaking new study may offer a way to stem that rise, while another may offer some hope for those who are already allergic.

+

Parents have been told for years to avoid giving foods containing peanuts to babies for fear of triggering an allergy. Now research shows the opposite is true: Feeding babies snacks made with peanuts before their first birthday appears to prevent that from happening.

+

The study is published in the New England Journal of Medicine, and it was presented at the annual meeting of the American Academy of Allergy, Asthma and Immunology in Houston. It found that among children at high risk for getting peanut allergies, eating peanut snacks by 11 months of age and continuing to eat them at least three times a week until age 5 cut their chances of becoming allergic by more than 80% compared to kids who avoided peanuts. Those at high risk were already allergic to egg, they had the skin condition eczema, or both.

+

Overall, about 3% of kids who ate peanut butter or peanut snacks before their first birthday got an allergy, compared to about 17% of kids who didn’t eat them.

+

“I think this study is an astounding and groundbreaking study, really,” says Katie Allen, MD, PhD. She's the director of the Center for Food and Allergy Research at the Murdoch Children’s Research Institute in Melbourne, Australia. Allen was not involved in the research.

+

Experts say the research should shift thinking about how kids develop food allergies, and it should change the guidance doctors give to parents.

+

Meanwhile, for children and adults who are already allergic to peanuts, another study presented at the same meeting held out hope of a treatment.

+

A new skin patch called Viaskin allowed people with peanut allergies to eat tiny amounts of peanuts after they wore it for a year.

+ +

A Change in Guidelines?

+

Allergies to peanuts and other foods are on the rise. In the U.S., more than 2% of people react to peanuts, a 400% increase since 1997. And reactions to peanuts and other tree nuts can be especially severe. Nuts are the main reason people get a life-threatening problem called anaphylaxis.

+
+
\ No newline at end of file diff --git a/test/test-pages/webmd-1/source.html b/test/test-pages/webmd-1/source.html new file mode 100644 index 0000000..f88057c --- /dev/null +++ b/test/test-pages/webmd-1/source.html @@ -0,0 +1,2411 @@ + + + + + Babies Who Eat Peanuts Early May Avoid Allergy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + +
+
+
+
+
+
+ +
+
+
+
+
+
Skip to content + + +
+
+ + + +
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+

Allergies Health Center

+ +
+
+ +
+
+
+
+
+
+
+ + + +
+
+ +
+ +
+
Font Size
+
+
A + +
+
A + +
+
A + +
+
+
+
+ +
+ + + +
+

Babies Who Eat Peanuts Early May Avoid Allergy

+ +
+
By +
WebMD Health News
+
Reviewed by Hansa D. Bhargava, MD +
+
+

+ +

+

Feb. 23, 2015 -- Life-threatening peanut allergies have mysteriously been + on the rise in the past decade, with little hope for a cure.

+

But a groundbreaking new study may offer a way to stem that rise, while + another may offer some hope for those who are already allergic.

+

Parents have been told for years to avoid giving foods containing peanuts + to babies for fear of triggering an allergy. Now research shows the opposite + is true: Feeding babies snacks made with peanuts before their first birthday + appears to prevent that from happening.

+

The study is published in the New England Journal of Medicine, and + it was presented at the annual meeting of the American Academy of Allergy, + Asthma and Immunology in Houston. It found that among children at high + risk for getting peanut allergies, eating peanut snacks by 11 months of + age and continuing to eat them at least three times a week until age 5 + cut their chances of becoming allergic by more than 80% compared to kids + who avoided peanuts. Those at high risk were already allergic to egg, they + had the skin condition eczema, or + both.

+

Overall, about 3% of kids who ate peanut butter or peanut snacks before + their first birthday got an allergy, compared to about 17% of kids who + didn’t eat them.

+

“I think this study is an astounding and groundbreaking study, really,” + says Katie Allen, MD, PhD. She's the director of the Center for Food and + Allergy Research at the Murdoch Children’s Research Institute in Melbourne, + Australia. Allen was not involved in the research.

+

Experts say the research should shift thinking about how kids develop + food allergies, and it should change the guidance doctors give to + parents.

+

Meanwhile, for children and adults who are already allergic to peanuts, + another study presented at the same meeting held out hope of a treatment.

+

A new skin patch called Viaskin allowed people with peanut allergies to + eat tiny amounts of peanuts after they wore it for a year.

+

+ +

A Change in Guidelines?

+ +

Allergies to peanuts and other foods are on the rise. In the U.S., more + than 2% of people react to peanuts, a 400% increase since 1997. And reactions + to peanuts and other tree nuts can be especially severe. Nuts are the main + reason people get a life-threatening problem called anaphylaxis.

+
+
+
+ +
+
+
1 + | + 2 + + | 3 + + | 4 + + | 5 + + +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+ +
+ + + + + + +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+

Today on WebMD

+ +
+
+ man blowing nose + + + +
Make these tweaks to your diet, home, and lifestyle.
+
+
+ Allergy capsule + + + +
Breathe easier with these products.
+
+
 
+
+ cat on couch + + + +
Live in harmony with your cat or dog.
+
+
+ Woman sneezing with tissue in meadow + + + +
Which ones affect you?
+
+
 
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ +
+

+ +
+
+ blowing nose + + +
Article
+ +
+
+ woman with sore throat + + +
Article
+ +
+
 
+
+ lone star tick + + +
Slideshow
+ +
+
+ Woman blowing nose + + +
Slideshow
+ +
+
 
+ + +
+
+
+
+ +
+ +
+
+

Send yourself a link to download the app.

+
+ +
+
+ +
+
+
+
+
Loading ...
+

Please wait...

+
+
+

This feature is temporarily unavailable. Please try again later.

+
+
+

Thanks!

+ +

Now check your email account on your mobile phone to download your new + app.

+
+
+ +
+
+
+

+ +
+
+ cat lying on shelf + + +
Article
+ +
+
+ Allergy prick test + + +
VIDEO
+ +
+
 
+
+ Man sneezing into tissue + + +
Assessment
+ +
+
+ Woman holding feather duster up to face, twitching + + +
Quiz
+ +
+
 
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ +
+
+
+ + + + + -- cgit v1.2.3