Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

rank.js 567 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. const rank = require('../../../script/search/rank')
  2. test('search custom rankings', () => {
  3. const expectedRankings = [
  4. ['https://docs.github.com/en/github/actions', 3],
  5. ['https://docs.github.com/en/rest/reference', 2],
  6. ['https://docs.github.com/en/graphql', 1],
  7. ['https://docs.github.com/en/github/site-policy', 0]
  8. ]
  9. expectedRankings.forEach(([url, expectedRanking]) => {
  10. const expectationMessage = `expected ${url} to have a custom ranking of ${expectedRanking}`
  11. expect(rank({ url }), expectationMessage).toBe(expectedRanking)
  12. })
  13. })
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...