source: frontend/node_modules/fast-uri/test/uri-js-compatibility.test.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1019 bytes
RevLine 
[9af201e]1'use strict'
2
3const test = require('tape')
4const fastURI = require('../')
5
6const uriJsParseFixtures = require('./fixtures/uri-js-parse.json')
7const uriJsSerializeFixtures = require('./fixtures/uri-js-serialize.json')
8
9test('uri-js compatibility Parse', (t) => {
10 uriJsParseFixtures.forEach((
11 [value, expected]
12 ) => {
13 if (value === '//10.10.000.10') {
14 return t.skip('Skipping //10.10.000.10 as it is not a valid URI per URI spec: https://datatracker.ietf.org/doc/html/rfc5954#section-4.1')
15 }
16 if (value.slice(0, 6) === 'mailto') {
17 return t.skip('Skipping mailto schema test as it is not supported by fastifyURI')
18 }
19 t.same(JSON.parse(JSON.stringify(fastURI.parse(value))), expected, 'Compatibility parse: ' + value)
20 })
21 t.end()
22})
23
24test('uri-js compatibility serialize', (t) => {
25 uriJsSerializeFixtures.forEach(([value, expected]) => {
26 t.same(
27 fastURI.serialize(value),
28 expected,
29 'Compatibility serialize: ' + JSON.stringify(value)
30 )
31 })
32 t.end()
33})
Note: See TracBrowser for help on using the repository browser.