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

language-code-redirects.js 970 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
16
17
18
19
20
21
22
23
24
25
26
27
  1. const { get } = require('../helpers/supertest')
  2. describe('language code redirects', () => {
  3. jest.setTimeout(5 * 60 * 1000)
  4. test('redirects accidental /jp* requests to /ja*', async () => {
  5. let $
  6. $ = await get('/jp', { dom: false })
  7. expect($.res.statusCode).toBe(301)
  8. expect($.res.headers.location).toBe('/ja')
  9. $ = await get('/jp/articles/about-your-personal-dashboard', { dom: false })
  10. expect($.res.statusCode).toBe(301)
  11. expect($.res.headers.location).toBe('/ja/articles/about-your-personal-dashboard')
  12. })
  13. test('redirects accidental /zh-CN* requests to /cn*', async () => {
  14. let $
  15. $ = await get('/zh-CN', { dom: false })
  16. expect($.res.statusCode).toBe(301)
  17. expect($.res.headers.location).toBe('/cn')
  18. $ = await get('/zh-TW/articles/about-your-personal-dashboard', { dom: false })
  19. expect($.res.statusCode).toBe(301)
  20. expect($.res.headers.location).toBe('/cn/articles/about-your-personal-dashboard')
  21. })
  22. })
Tip!

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

Comments

Loading...