|
1 | | -import { describe, expect } from 'vitest'; |
| 1 | +import { describe, expect, it } from 'vitest'; |
2 | 2 | import deflate from './deflate'; |
3 | 3 |
|
4 | | -describe('deflates json', () => { |
5 | | - expect(deflate({ 'foo-bar': { baz: [{ biz: ['value1', 'value2'] }] } }, '')) |
6 | | - .toStrictEqual(['foo-bar.baz[0].biz[0]=value1', 'foo-bar.baz[0].biz[1]=value2']); |
7 | | -}); |
| 4 | +describe('deflate', () => { |
| 5 | + it('deflates json', () => { |
| 6 | + expect(deflate({ 'foo-bar': { baz: [{ biz: ['value1', 'value2'] }] } }, '')) |
| 7 | + .toStrictEqual(['foo-bar.baz[0].biz[0]=value1', 'foo-bar.baz[0].biz[1]=value2']); |
| 8 | + }); |
8 | 9 |
|
9 | | -describe('deflates large json', () => { |
10 | | - expect(deflate({ |
11 | | - cloud: { |
12 | | - gateway: { |
13 | | - routes: [ |
14 | | - { |
15 | | - id: 'after_route', |
16 | | - uri: 'https://example.org', |
17 | | - predicates: [ |
18 | | - { |
19 | | - name: 'Cookie', |
20 | | - args: { |
21 | | - name: 'mycookie', |
22 | | - regexp: 'mycookievalue', |
| 10 | + it('deflates large json', () => { |
| 11 | + expect(deflate({ |
| 12 | + cloud: { |
| 13 | + gateway: { |
| 14 | + routes: [ |
| 15 | + { |
| 16 | + id: 'after_route', |
| 17 | + uri: 'https://example.org', |
| 18 | + predicates: [ |
| 19 | + { |
| 20 | + name: 'Cookie', |
| 21 | + args: { |
| 22 | + name: 'mycookie', |
| 23 | + regexp: 'mycookievalue', |
| 24 | + }, |
23 | 25 | }, |
24 | | - }, |
25 | | - ], |
26 | | - }, |
27 | | - ], |
| 26 | + ], |
| 27 | + }, |
| 28 | + ], |
| 29 | + }, |
28 | 30 | }, |
29 | | - }, |
30 | | - }, '')) |
31 | | - .toStrictEqual( |
32 | | - ['cloud.gateway.routes[0].id=after_route', |
33 | | - 'cloud.gateway.routes[0].uri=https://example.org', |
34 | | - 'cloud.gateway.routes[0].predicates[0].name=Cookie', |
35 | | - 'cloud.gateway.routes[0].predicates[0].args.name=mycookie', |
36 | | - 'cloud.gateway.routes[0].predicates[0].args.regexp=mycookievalue']); |
| 31 | + }, '')) |
| 32 | + .toStrictEqual( |
| 33 | + ['cloud.gateway.routes[0].id=after_route', |
| 34 | + 'cloud.gateway.routes[0].uri=https://example.org', |
| 35 | + 'cloud.gateway.routes[0].predicates[0].name=Cookie', |
| 36 | + 'cloud.gateway.routes[0].predicates[0].args.name=mycookie', |
| 37 | + 'cloud.gateway.routes[0].predicates[0].args.regexp=mycookievalue']); |
| 38 | + }); |
37 | 39 | }); |
0 commit comments