You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mercury-parser/src/extractors/generic/content/scoring/set-score.test.js

24 lines
484 B
JavaScript

import assert from 'assert'
import cheerio from 'cheerio'
import {
setScore,
getScore
} from './index'
describe('Scoring utils', () => {
describe('setScore(node, $, amount)', () => {
it("sets the specified amount as the node's score", () => {
const $ = cheerio.load('<p>Foo</p>')
let $node = $('p').first()
const newScore = 25
$node = setScore($node, $, newScore)
const score = getScore($node)
assert(score, newScore)
})
})
})