1
0
mirror of synced 2026-01-06 15:01:04 -05:00
Files
docs/tests/unit/search/rank.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

16 lines
566 B
JavaScript

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