boston-food-trucks-info
Version:
Simple library to scrape data from the boston food trucks website
25 lines (21 loc) • 625 B
JavaScript
const fs = require("fs");
const path = require("path");
const cheerio = require("cheerio");
const { getFoodTruckSchedule } = require(path.join(__dirname, ".."));
const html = fs.readFileSync(path.join(__dirname, "__data__", "city-boston-food-trucks-schedule.html"));
const $ = cheerio.load(html);
const LOCATIONS = [
"Opera Place",
"BU West",
"BU East",
"China Trade Building",
"Stuart Street",
"Belvidere Street"
]
describe("getJsonForLocation", () => {
LOCATIONS.forEach(location => {
it(`works on ${location}`, () => {
expect(getFoodTruckSchedule($, location)).toMatchSnapshot();
})
})
})