fix: changed parseInt to parseFloat

pull/1/head
Adam Pash 8 years ago
parent 44eae5e931
commit c470261d41

@ -2,5 +2,5 @@
// the node's score attribute
// returns null if no score set
export default function getScore(node, $) {
return parseInt($(node).attr('score')) || null
return parseFloat($(node).attr('score')) || null
}

@ -2,9 +2,7 @@ import assert from 'assert'
import cheerio from 'cheerio'
import fs from 'fs'
import {
clean
} from '../dom/test-helpers'
import { clean } from '../dom/test-helpers'
import HTML from './fixtures/html'
import {
@ -38,7 +36,7 @@ describe('scoreContent($, weightNodes)', () => {
const result = scoreContent($).html()
// assert.equal(getScore($('article').first(), $), 63.75)
assert.equal(getScore($('article').first(), $), 67)
assert.equal(getScore($('article').first(), $), 70.5)
})
// it("scores this NYT article the same", () => {

Loading…
Cancel
Save