masticate 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,73 +4,47 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SchemaOrgJsonRecipeParser = void 0;
7
-
8
7
  var _recipe = require("./recipe");
9
-
10
8
  var _recipe_parser = require("./recipe_parser");
11
-
12
9
  var _cheerio = _interopRequireDefault(require("cheerio"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
11
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
17
-
18
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
-
20
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
-
22
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
23
-
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
24
15
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
-
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
28
17
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
-
30
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
-
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
34
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
-
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
36
21
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
37
-
38
22
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
-
40
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
41
-
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
-
44
- var SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
45
- _inherits(SchemaOrgJsonRecipeParser, _RecipeParser);
46
-
47
- var _super = _createSuper(SchemaOrgJsonRecipeParser);
48
-
23
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
24
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
26
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
+ var SchemaOrgJsonRecipeParser = exports.SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
49
28
  function SchemaOrgJsonRecipeParser(doc) {
50
29
  var _this;
51
-
52
30
  _classCallCheck(this, SchemaOrgJsonRecipeParser);
53
-
54
- _this = _super.call(this, doc);
31
+ _this = _callSuper(this, SchemaOrgJsonRecipeParser, [doc]);
55
32
  _this.obj = null;
56
-
57
33
  _this.find_linked_data(doc);
58
-
59
34
  return _this;
60
35
  }
61
-
62
- _createClass(SchemaOrgJsonRecipeParser, [{
36
+ _inherits(SchemaOrgJsonRecipeParser, _RecipeParser);
37
+ return _createClass(SchemaOrgJsonRecipeParser, [{
63
38
  key: "find_linked_data",
64
39
  value: function find_linked_data(doc) {
65
40
  var self = this;
66
41
  var nodes = this.doc('script[type="application/ld+json"]');
67
42
  nodes.each(function (i, node) {
68
43
  try {
69
- var html = (0, _cheerio["default"])(node).html(); // newlines in side string literal cause parse errors. so get rid of all of them
70
-
44
+ var html = (0, _cheerio["default"])(node).html();
45
+ // newlines in side string literal cause parse errors. so get rid of all of them
71
46
  html = html.replace(/\s+/g, " ");
72
47
  var obj = JSON.parse(html);
73
-
74
48
  if (obj["@context"].startsWith("http://schema.org") && obj["@type"] == "Recipe") {
75
49
  self.obj = obj;
76
50
  return false;
@@ -122,10 +96,8 @@ var SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
122
96
  switch (_typeof(this.obj["image"])) {
123
97
  case 'object':
124
98
  return this.obj["image"]["url"];
125
-
126
99
  case 'string':
127
100
  return this.obj["image"];
128
-
129
101
  default:
130
102
  return null;
131
103
  }
@@ -154,10 +126,8 @@ var SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
154
126
  value: function parse_instructions() {
155
127
  if (_typeof(this.obj["recipeInstructions"]) == 'object') {
156
128
  var inst = "";
157
-
158
129
  var _iterator = _createForOfIteratorHelper(this.obj["recipeInstructions"]),
159
- _step;
160
-
130
+ _step;
161
131
  try {
162
132
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
163
133
  var text = _step.value;
@@ -168,7 +138,6 @@ var SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
168
138
  } finally {
169
139
  _iterator.f();
170
140
  }
171
-
172
141
  return inst;
173
142
  } else {
174
143
  return this.obj["recipeInstructions"];
@@ -186,8 +155,4 @@ var SchemaOrgJsonRecipeParser = /*#__PURE__*/function (_RecipeParser) {
186
155
  return parser.obj != null;
187
156
  }
188
157
  }]);
189
-
190
- return SchemaOrgJsonRecipeParser;
191
- }(_recipe_parser.RecipeParser);
192
-
193
- exports.SchemaOrgJsonRecipeParser = SchemaOrgJsonRecipeParser;
158
+ }(_recipe_parser.RecipeParser);
@@ -1,237 +1,193 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
4
  var _index = require("./index");
4
-
5
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
5
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
-
7
7
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
-
9
8
  var fs = require("fs");
10
-
11
9
  var expect = require("chai").expect;
12
-
13
10
  describe("Schema.org JSON Parser", function () {
14
11
  describe("geniuskitche.html", function () {
15
- it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
16
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
17
- while (1) {
18
- switch (_context2.prev = _context2.next) {
19
- case 0:
20
- fs.readFile("test/fixtures/geniuskitchen.html", /*#__PURE__*/function () {
21
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(err, html) {
22
- var rec, expected, i;
23
- return regeneratorRuntime.wrap(function _callee$(_context) {
24
- while (1) {
25
- switch (_context.prev = _context.next) {
26
- case 0:
27
- _context.next = 2;
28
- return _index.Masticate.parse(html);
29
-
30
- case 2:
31
- rec = _context.sent;
32
- expect(rec.name).to.equal("Almond Fudge Banana Cake");
33
- expect(rec.author).to.equal("CoolMonday");
34
- expect(rec.description).to.equal("Make and share this Almond Fudge Banana Cake recipe from Food.com.");
35
- expect(rec.image_url).to.equal("https://img.sndimg.com/food/image/upload/w_555,h_416,c_fit,fl_progressive,q_95/v1/img/recipes/14/2/picZy4Zce.jpg");
36
- expected = ["3 DOLE&reg; Banana, peeled (extra-ripe medium)", "1 1/2 cups sugar", "1/2 cup margarine, softened", "3 eggs", "3 tablespoons amaretto liqueur or 1/2-1 teaspoon almond extract", "1 teaspoon vanilla extract", "1 1/3 cups all-purpose flour", "1/3 cup unsweetened cocoa powder", "1 teaspoon baking soda", "1/2 teaspoon salt", "1/2 cup Dole Almond, chopped, toasted & ground"];
37
- expect(rec.ingredients.length).to.equal(expected.length);
38
-
39
- for (i = 0; i > rec.ingredients.length; i++) {
40
- expect(rec.ingredients[i]).to.equal([expected[i]]);
41
- }
42
-
43
- expect(rec.instructions).to.equal("Mash bananas and set aside. Beat sugar and margarine until light and fluffy. Beat in eggs, liqueur and vanilla. Combine dry ingredients. Stir in almonds. Add to sugar mixture alternately with bananas. Beat well. Pour batter into greased 10-inch Bundt pan. Bake in preheated 350&deg;F oven 45 to 50 minutes or until toothpick inserted in center comes out almost clean and cake pulls away from side of pan. Cool 10 minutes. Remove cake from pan to wire rack to cool completely. Drizzle glaze over top and down side of cake. Make 16-20 servings.");
44
- expect(rec.cook_time).to.equal(60);
45
- expect(rec.prep_time).to.equal(50);
46
- expect(rec.total_time).to.equal(110);
47
- expect(rec.published_date).to.equal(Date.parse("August 20, 1999"));
48
- expect(rec["yield"]).to.equal('16-20 serving(s)');
49
-
50
- case 16:
51
- case "end":
52
- return _context.stop();
12
+ it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
13
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
14
+ while (1) switch (_context2.prev = _context2.next) {
15
+ case 0:
16
+ fs.readFile("test/fixtures/geniuskitchen.html", /*#__PURE__*/function () {
17
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, html) {
18
+ var rec, expected, i;
19
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ _context.next = 2;
23
+ return _index.Masticate.parse(html);
24
+ case 2:
25
+ rec = _context.sent;
26
+ expect(rec.name).to.equal("Almond Fudge Banana Cake");
27
+ expect(rec.author).to.equal("CoolMonday");
28
+ expect(rec.description).to.equal("Make and share this Almond Fudge Banana Cake recipe from Food.com.");
29
+ expect(rec.image_url).to.equal("https://img.sndimg.com/food/image/upload/w_555,h_416,c_fit,fl_progressive,q_95/v1/img/recipes/14/2/picZy4Zce.jpg");
30
+ expected = ["3 DOLE&reg; Banana, peeled (extra-ripe medium)", "1 1/2 cups sugar", "1/2 cup margarine, softened", "3 eggs", "3 tablespoons amaretto liqueur or 1/2-1 teaspoon almond extract", "1 teaspoon vanilla extract", "1 1/3 cups all-purpose flour", "1/3 cup unsweetened cocoa powder", "1 teaspoon baking soda", "1/2 teaspoon salt", "1/2 cup Dole Almond, chopped, toasted & ground"];
31
+ expect(rec.ingredients.length).to.equal(expected.length);
32
+ for (i = 0; i > rec.ingredients.length; i++) {
33
+ expect(rec.ingredients[i]).to.equal([expected[i]]);
53
34
  }
54
- }
55
- }, _callee);
56
- }));
57
-
58
- return function (_x, _x2) {
59
- return _ref2.apply(this, arguments);
60
- };
61
- }());
62
-
63
- case 1:
64
- case "end":
65
- return _context2.stop();
66
- }
35
+ expect(rec.instructions).to.equal("Mash bananas and set aside. Beat sugar and margarine until light and fluffy. Beat in eggs, liqueur and vanilla. Combine dry ingredients. Stir in almonds. Add to sugar mixture alternately with bananas. Beat well. Pour batter into greased 10-inch Bundt pan. Bake in preheated 350&deg;F oven 45 to 50 minutes or until toothpick inserted in center comes out almost clean and cake pulls away from side of pan. Cool 10 minutes. Remove cake from pan to wire rack to cool completely. Drizzle glaze over top and down side of cake. Make 16-20 servings.");
36
+ expect(rec.cook_time).to.equal(60);
37
+ expect(rec.prep_time).to.equal(50);
38
+ expect(rec.total_time).to.equal(110);
39
+ expect(rec.published_date).to.equal(Date.parse("August 20, 1999"));
40
+ expect(rec["yield"]).to.equal('16-20 serving(s)');
41
+ case 16:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }, _callee);
46
+ }));
47
+ return function (_x, _x2) {
48
+ return _ref2.apply(this, arguments);
49
+ };
50
+ }());
51
+ case 1:
52
+ case "end":
53
+ return _context2.stop();
67
54
  }
68
55
  }, _callee2);
69
56
  })));
70
57
  });
71
58
  describe("foodnetwork.html", function () {
72
- it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
73
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
74
- while (1) {
75
- switch (_context4.prev = _context4.next) {
76
- case 0:
77
- fs.readFile("test/fixtures/foodnetwork.html", /*#__PURE__*/function () {
78
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(err, html) {
79
- var rec, expected, i;
80
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
81
- while (1) {
82
- switch (_context3.prev = _context3.next) {
83
- case 0:
84
- _context3.next = 2;
85
- return _index.Masticate.parse(html);
86
-
87
- case 2:
88
- rec = _context3.sent;
89
- expect(rec.name).to.equal("Charred Ahi Tuna with Sun-dried Tomato Tapenade and Farrotto Salad");
90
- expect(rec.author).to.equal("Food Network");
91
- expect(rec.description).to.equal(null);
92
- expect(rec.image_url).to.equal("http://food.fnr.sndimg.com/content/dam/images/food/editorial/homepage/fn-feature.jpg.rend.hgtvcom.406.229.suffix/1474463768097.jpeg");
93
- expected = ["4 (8 ounce) pieces fresh ahi tuna, bloodline removed", "4 tablespoons olive oil", "Salt and pepper", "Sun-dried Tomato Tapenade, recipe follows", "Lemon wedges, as an accompaniment", "Farrotto Salad, recipe follows", "1 cup marinated sun-dried tomatoes", "1 cup pitted green olives", "2 lemons, zested and juiced", "1/2 cup olive oil", "2 tablespoons minced garlic", "2 tablespoons capers", "2 tablespoons chopped fresh parsley", "2 tablespoons chopped fresh basil", "1/2 cup grated Parmesan, Romano or Asiago", "1/2 teaspoon fresh ground black pepper", "1/2 medium yellow onion, diced", "2 tablespoons minced garlic", "2 tablespoons olive oil", "1 tablespoon butter", "1 cup faro", "2 cups water", "1/2 cup crumbled feta", "4 Roma tomatoes, seeded and chopped", "1/2 cup chopped parsley", "Salt and pepper"];
94
- expect(rec.ingredients.length).to.equal(expected.length);
95
-
96
- for (i = 0; i > rec.ingredients.length; i++) {
97
- expect(rec.ingredients[i]).to.equal([expected[i]]);
98
- }
99
-
100
- expect(rec.instructions).to.equal("In a cast iron skillet, on high heat or over a charcoal grill, cook the tuna steaks on each side for just 2 to 3 minutes, keeping the fish on the rare side of medium rare. Spread 2 tablespoons of artichoke tapenade on the fish after turning them over the first time.\n" + "Serve with lemon wedges and Faro Salad\n" + "In a food processor, puree all the ingredients together. Set aside. (This also makes a great crostini topping.)\n" + "In a heavy-bottomed saucepan on medium heat, sweat the onions and garlic in the oil and butter until translucent, about 5 minutes. Add the faro and saute for 1 minute more, so that each grain is coated with oil. Add the water and bring to a boil. Lower the heat to a simmer and cover for 35 to 40 minutes, or until liquid is absorbed and faro is cooked. Turn off heat and let the faro rest covered for another 10 minutes. Stir in cheese, tomatoes and parsley. Season, to taste.");
101
- expect(rec.cook_time).to.equal(45);
102
- expect(rec.prep_time).to.equal(40);
103
- expect(rec.total_time).to.equal(95);
104
- expect(rec.published_date).to.equal(Date.parse("2016-12-09T23:30:40.382-05:00"));
105
- expect(rec["yield"]).to.equal('4 servings');
106
-
107
- case 16:
108
- case "end":
109
- return _context3.stop();
59
+ it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
60
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
61
+ while (1) switch (_context4.prev = _context4.next) {
62
+ case 0:
63
+ fs.readFile("test/fixtures/foodnetwork.html", /*#__PURE__*/function () {
64
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, html) {
65
+ var rec, expected, i;
66
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
67
+ while (1) switch (_context3.prev = _context3.next) {
68
+ case 0:
69
+ _context3.next = 2;
70
+ return _index.Masticate.parse(html);
71
+ case 2:
72
+ rec = _context3.sent;
73
+ expect(rec.name).to.equal("Charred Ahi Tuna with Sun-dried Tomato Tapenade and Farrotto Salad");
74
+ expect(rec.author).to.equal("Food Network");
75
+ expect(rec.description).to.equal(null);
76
+ expect(rec.image_url).to.equal("http://food.fnr.sndimg.com/content/dam/images/food/editorial/homepage/fn-feature.jpg.rend.hgtvcom.406.229.suffix/1474463768097.jpeg");
77
+ expected = ["4 (8 ounce) pieces fresh ahi tuna, bloodline removed", "4 tablespoons olive oil", "Salt and pepper", "Sun-dried Tomato Tapenade, recipe follows", "Lemon wedges, as an accompaniment", "Farrotto Salad, recipe follows", "1 cup marinated sun-dried tomatoes", "1 cup pitted green olives", "2 lemons, zested and juiced", "1/2 cup olive oil", "2 tablespoons minced garlic", "2 tablespoons capers", "2 tablespoons chopped fresh parsley", "2 tablespoons chopped fresh basil", "1/2 cup grated Parmesan, Romano or Asiago", "1/2 teaspoon fresh ground black pepper", "1/2 medium yellow onion, diced", "2 tablespoons minced garlic", "2 tablespoons olive oil", "1 tablespoon butter", "1 cup faro", "2 cups water", "1/2 cup crumbled feta", "4 Roma tomatoes, seeded and chopped", "1/2 cup chopped parsley", "Salt and pepper"];
78
+ expect(rec.ingredients.length).to.equal(expected.length);
79
+ for (i = 0; i > rec.ingredients.length; i++) {
80
+ expect(rec.ingredients[i]).to.equal([expected[i]]);
110
81
  }
111
- }
112
- }, _callee3);
113
- }));
114
-
115
- return function (_x3, _x4) {
116
- return _ref4.apply(this, arguments);
117
- };
118
- }());
119
-
120
- case 1:
121
- case "end":
122
- return _context4.stop();
123
- }
82
+ expect(rec.instructions).to.equal("In a cast iron skillet, on high heat or over a charcoal grill, cook the tuna steaks on each side for just 2 to 3 minutes, keeping the fish on the rare side of medium rare. Spread 2 tablespoons of artichoke tapenade on the fish after turning them over the first time.\n" + "Serve with lemon wedges and Faro Salad\n" + "In a food processor, puree all the ingredients together. Set aside. (This also makes a great crostini topping.)\n" + "In a heavy-bottomed saucepan on medium heat, sweat the onions and garlic in the oil and butter until translucent, about 5 minutes. Add the faro and saute for 1 minute more, so that each grain is coated with oil. Add the water and bring to a boil. Lower the heat to a simmer and cover for 35 to 40 minutes, or until liquid is absorbed and faro is cooked. Turn off heat and let the faro rest covered for another 10 minutes. Stir in cheese, tomatoes and parsley. Season, to taste.");
83
+ expect(rec.cook_time).to.equal(45);
84
+ expect(rec.prep_time).to.equal(40);
85
+ expect(rec.total_time).to.equal(95);
86
+ expect(rec.published_date).to.equal(Date.parse("2016-12-09T23:30:40.382-05:00"));
87
+ expect(rec["yield"]).to.equal('4 servings');
88
+ case 16:
89
+ case "end":
90
+ return _context3.stop();
91
+ }
92
+ }, _callee3);
93
+ }));
94
+ return function (_x3, _x4) {
95
+ return _ref4.apply(this, arguments);
96
+ };
97
+ }());
98
+ case 1:
99
+ case "end":
100
+ return _context4.stop();
124
101
  }
125
102
  }, _callee4);
126
103
  })));
127
104
  });
128
105
  describe("thespriceeats.html", function () {
129
- it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
130
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
131
- while (1) {
132
- switch (_context6.prev = _context6.next) {
133
- case 0:
134
- fs.readFile("test/fixtures/thespruceeats.html", /*#__PURE__*/function () {
135
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(err, html) {
136
- var rec, expected, i;
137
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
138
- while (1) {
139
- switch (_context5.prev = _context5.next) {
140
- case 0:
141
- _context5.next = 2;
142
- return _index.Masticate.parse(html);
143
-
144
- case 2:
145
- rec = _context5.sent;
146
- expect(rec.name).to.equal("Spring Leek Frittata");
147
- expect(rec.author).to.equal("Molly Watson");
148
- expect(rec.description).to.equal("Create an amazingly fresh and green frittata filled with spring herbs and tender leeks with this simple recipe.");
149
- expect(rec.image_url).to.equal(undefined);
150
- expected = ['2 small <a href="https://www.thespruceeats.com/all-about-leeks-4122305">leeks</a>', '2 tablespoons butter', '1 teaspoon fine sea salt (divided)', '1 large potato', '8 <a href="https://www.thespruceeats.com/types-of-eggs-2216257">eggs</a>', '1/2 cup chopped spring herbs (a mix of mint, dill, and parsley is particularly tasty)'];
151
- expect(rec.ingredients.length).to.equal(expected.length);
152
-
153
- for (i = 0; i > rec.ingredients.length; i++) {
154
- expect(rec.ingredients[i]).to.equal([expected[i]]);
155
- }
156
-
157
- expect(rec.instructions).to.equal("&lt;p&gt;Trim the leeks, cut them in half lengthwise, and thinly slice. Go ahead and use the darker green parts as long as they aren&amp;#39;t dried out. Put the leeks in a colander and rinse under cold running water to remove any dirt or grit.&lt;/p&gt; &lt;p&gt;In a large frying pan over medium heat, melt the butter. Add the leeks, including any water clinging to them, and add 1/2 teaspoon of the salt. Cook, covered, stirring now and again, until the leeks are very tender, 20 to 30 minutes.&lt;/p&gt; &lt;p&gt;Meanwhile, peel and grate the potato into a medium saucepan, cover with water and the remaining 1/2 teaspoon salt. Bring to a boil over high heat. Adjust the heat to maintain a steady simmer and cook until the potato is just tender, about 5 minutes. Drain and rinse with cold water to cool off. Working in a small handful at a time, squeeze the potato dry. &lt;/p&gt; &lt;p&gt;Put the eggs in a large bowl and whisk until completely blended. Add the potatoes, leeks, and herbs. Stir to combine.&lt;/p&gt; &lt;p&gt;Heat an oven-safe 10-inch frying pan over medium-high heat. Coat with spray oil. Pour in the frittata mixture, using a spoon or spatula to even out the top. Cook for a few minutes until the edges are set. Reduce the heat to low and cook until the frittata is set except just in the center.&lt;/p&gt; &lt;p&gt;Heat a &lt;a href=&quot;https://www.thespruceeats.com/a-crash-course-guide-to-using-your-broiler-4157844&quot; data-component=&quot;link&quot; data-source=&quot;inlineLink&quot; data-type=&quot;internalLink&quot; data-ordinal=&quot;1&quot;&gt;broiler&lt;/a&gt; and slip the pan under it. Cook until the top of the frittata is set and starting to brown.&lt;/p&gt; &lt;p&gt;Turn the frittata out onto a serving platter. Let cool slightly, slice, and serve warm or at room temperature (leftovers are pretty darn good cold, too!).&lt;/p&gt;");
158
- expect(rec.cook_time).to.equal(45);
159
- expect(rec.prep_time).to.equal(10);
160
- expect(rec.total_time).to.equal(55);
161
- expect(rec.published_date).to.equal(1489599563134);
162
- expect(rec["yield"]).to.equal('Makes 6 servings');
163
-
164
- case 16:
165
- case "end":
166
- return _context5.stop();
167
- }
168
- }
169
- }, _callee5);
170
- }));
171
-
172
- return function (_x5, _x6) {
173
- return _ref6.apply(this, arguments);
174
- };
175
- }());
176
-
177
- case 1:
178
- case "end":
179
- return _context6.stop();
180
- }
181
- }
182
- }, _callee6);
183
- })));
184
- });
185
- describe("yummly.html", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
186
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
187
- while (1) {
188
- switch (_context9.prev = _context9.next) {
106
+ it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
107
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
108
+ while (1) switch (_context6.prev = _context6.next) {
189
109
  case 0:
190
- it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
191
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
192
- while (1) {
193
- switch (_context8.prev = _context8.next) {
110
+ fs.readFile("test/fixtures/thespruceeats.html", /*#__PURE__*/function () {
111
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, html) {
112
+ var rec, expected, i;
113
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
114
+ while (1) switch (_context5.prev = _context5.next) {
194
115
  case 0:
195
- fs.readFile("test/fixtures/yummly.html", /*#__PURE__*/function () {
196
- var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(err, html) {
197
- var rec;
198
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
199
- while (1) {
200
- switch (_context7.prev = _context7.next) {
201
- case 0:
202
- _context7.next = 2;
203
- return _index.Masticate.parse(html);
204
-
205
- case 2:
206
- rec = _context7.sent;
207
- expect(rec.name).to.equal("1 2 3 Cake");
208
- expect(rec.author).to.equal("As receitas de casa");
209
-
210
- case 5:
211
- case "end":
212
- return _context7.stop();
213
- }
214
- }
215
- }, _callee7);
216
- }));
217
-
218
- return function (_x7, _x8) {
219
- return _ref9.apply(this, arguments);
220
- };
221
- }());
222
-
223
- case 1:
116
+ _context5.next = 2;
117
+ return _index.Masticate.parse(html);
118
+ case 2:
119
+ rec = _context5.sent;
120
+ expect(rec.name).to.equal("Spring Leek Frittata");
121
+ expect(rec.author).to.equal("Molly Watson");
122
+ expect(rec.description).to.equal("Create an amazingly fresh and green frittata filled with spring herbs and tender leeks with this simple recipe.");
123
+ expect(rec.image_url).to.equal(undefined);
124
+ expected = ['2 small <a href="https://www.thespruceeats.com/all-about-leeks-4122305">leeks</a>', '2 tablespoons butter', '1 teaspoon fine sea salt (divided)', '1 large potato', '8 <a href="https://www.thespruceeats.com/types-of-eggs-2216257">eggs</a>', '1/2 cup chopped spring herbs (a mix of mint, dill, and parsley is particularly tasty)'];
125
+ expect(rec.ingredients.length).to.equal(expected.length);
126
+ for (i = 0; i > rec.ingredients.length; i++) {
127
+ expect(rec.ingredients[i]).to.equal([expected[i]]);
128
+ }
129
+ expect(rec.instructions).to.equal("&lt;p&gt;Trim the leeks, cut them in half lengthwise, and thinly slice. Go ahead and use the darker green parts as long as they aren&amp;#39;t dried out. Put the leeks in a colander and rinse under cold running water to remove any dirt or grit.&lt;/p&gt; &lt;p&gt;In a large frying pan over medium heat, melt the butter. Add the leeks, including any water clinging to them, and add 1/2 teaspoon of the salt. Cook, covered, stirring now and again, until the leeks are very tender, 20 to 30 minutes.&lt;/p&gt; &lt;p&gt;Meanwhile, peel and grate the potato into a medium saucepan, cover with water and the remaining 1/2 teaspoon salt. Bring to a boil over high heat. Adjust the heat to maintain a steady simmer and cook until the potato is just tender, about 5 minutes. Drain and rinse with cold water to cool off. Working in a small handful at a time, squeeze the potato dry. &lt;/p&gt; &lt;p&gt;Put the eggs in a large bowl and whisk until completely blended. Add the potatoes, leeks, and herbs. Stir to combine.&lt;/p&gt; &lt;p&gt;Heat an oven-safe 10-inch frying pan over medium-high heat. Coat with spray oil. Pour in the frittata mixture, using a spoon or spatula to even out the top. Cook for a few minutes until the edges are set. Reduce the heat to low and cook until the frittata is set except just in the center.&lt;/p&gt; &lt;p&gt;Heat a &lt;a href=&quot;https://www.thespruceeats.com/a-crash-course-guide-to-using-your-broiler-4157844&quot; data-component=&quot;link&quot; data-source=&quot;inlineLink&quot; data-type=&quot;internalLink&quot; data-ordinal=&quot;1&quot;&gt;broiler&lt;/a&gt; and slip the pan under it. Cook until the top of the frittata is set and starting to brown.&lt;/p&gt; &lt;p&gt;Turn the frittata out onto a serving platter. Let cool slightly, slice, and serve warm or at room temperature (leftovers are pretty darn good cold, too!).&lt;/p&gt;");
130
+ expect(rec.cook_time).to.equal(45);
131
+ expect(rec.prep_time).to.equal(10);
132
+ expect(rec.total_time).to.equal(55);
133
+ expect(rec.published_date).to.equal(1489599563134);
134
+ expect(rec["yield"]).to.equal('Makes 6 servings');
135
+ case 16:
224
136
  case "end":
225
- return _context8.stop();
137
+ return _context5.stop();
226
138
  }
227
- }
228
- }, _callee8);
229
- })));
230
-
139
+ }, _callee5);
140
+ }));
141
+ return function (_x5, _x6) {
142
+ return _ref6.apply(this, arguments);
143
+ };
144
+ }());
231
145
  case 1:
232
146
  case "end":
233
- return _context9.stop();
147
+ return _context6.stop();
234
148
  }
149
+ }, _callee6);
150
+ })));
151
+ });
152
+ describe("yummly.html", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
153
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
154
+ while (1) switch (_context9.prev = _context9.next) {
155
+ case 0:
156
+ it("sets all values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
157
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
158
+ while (1) switch (_context8.prev = _context8.next) {
159
+ case 0:
160
+ fs.readFile("test/fixtures/yummly.html", /*#__PURE__*/function () {
161
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, html) {
162
+ var rec;
163
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
164
+ while (1) switch (_context7.prev = _context7.next) {
165
+ case 0:
166
+ _context7.next = 2;
167
+ return _index.Masticate.parse(html);
168
+ case 2:
169
+ rec = _context7.sent;
170
+ expect(rec.name).to.equal("1 2 3 Cake");
171
+ expect(rec.author).to.equal("As receitas lá de casa");
172
+ case 5:
173
+ case "end":
174
+ return _context7.stop();
175
+ }
176
+ }, _callee7);
177
+ }));
178
+ return function (_x7, _x8) {
179
+ return _ref9.apply(this, arguments);
180
+ };
181
+ }());
182
+ case 1:
183
+ case "end":
184
+ return _context8.stop();
185
+ }
186
+ }, _callee8);
187
+ })));
188
+ case 1:
189
+ case "end":
190
+ return _context9.stop();
235
191
  }
236
192
  }, _callee9);
237
193
  })));