1
0
mirror of synced 2025-12-30 12:02:01 -05:00
Files
docs/tests/unit/search/rank.js
2021-11-10 11:11:28 -08:00

16 lines
489 B
JavaScript

import rank from '../../../script/search/rank.js'
test('search custom rankings', () => {
const expectedRankings = [
['/en/github/actions', 3],
['/en/rest/reference', 2],
['/en/graphql', 1],
['/en/github/site-policy', 0],
]
expectedRankings.forEach(([objectID, expectedRanking]) => {
const expectationMessage = `expected ${objectID} to have a custom ranking of ${expectedRanking}`
expect(rank({ objectID }), expectationMessage).toBe(expectedRanking)
})
})