mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
fixup! feat(new tool): Env Variables Converter
This commit is contained in:
1 parent
dfe13de18b
commit
9f70133188
1 file changed
+33
-31
@@ -1,37 +1,39 @@
|
||||
import { describe, expect } from 'vitest';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import deflate from './deflate';
|
||||
|
||||
describe('deflates json', () => {
|
||||
expect(deflate({ 'foo-bar': { baz: [{ biz: ['value1', 'value2'] }] } }, ''))
|
||||
.toStrictEqual(['foo-bar.baz[0].biz[0]=value1', 'foo-bar.baz[0].biz[1]=value2']);
|
||||
});
|
||||
describe('deflate', () => {
|
||||
it('deflates json', () => {
|
||||
expect(deflate({ 'foo-bar': { baz: [{ biz: ['value1', 'value2'] }] } }, ''))
|
||||
.toStrictEqual(['foo-bar.baz[0].biz[0]=value1', 'foo-bar.baz[0].biz[1]=value2']);
|
||||
});
|
||||
|
||||
describe('deflates large json', () => {
|
||||
expect(deflate({
|
||||
cloud: {
|
||||
gateway: {
|
||||
routes: [
|
||||
{
|
||||
id: 'after_route',
|
||||
uri: 'https://example.org',
|
||||
predicates: [
|
||||
{
|
||||
name: 'Cookie',
|
||||
args: {
|
||||
name: 'mycookie',
|
||||
regexp: 'mycookievalue',
|
||||
it('deflates large json', () => {
|
||||
expect(deflate({
|
||||
cloud: {
|
||||
gateway: {
|
||||
routes: [
|
||||
{
|
||||
id: 'after_route',
|
||||
uri: 'https://example.org',
|
||||
predicates: [
|
||||
{
|
||||
name: 'Cookie',
|
||||
args: {
|
||||
name: 'mycookie',
|
||||
regexp: 'mycookievalue',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}, ''))
|
||||
.toStrictEqual(
|
||||
['cloud.gateway.routes[0].id=after_route',
|
||||
'cloud.gateway.routes[0].uri=https://example.org',
|
||||
'cloud.gateway.routes[0].predicates[0].name=Cookie',
|
||||
'cloud.gateway.routes[0].predicates[0].args.name=mycookie',
|
||||
'cloud.gateway.routes[0].predicates[0].args.regexp=mycookievalue']);
|
||||
}, ''))
|
||||
.toStrictEqual(
|
||||
['cloud.gateway.routes[0].id=after_route',
|
||||
'cloud.gateway.routes[0].uri=https://example.org',
|
||||
'cloud.gateway.routes[0].predicates[0].name=Cookie',
|
||||
'cloud.gateway.routes[0].predicates[0].args.name=mycookie',
|
||||
'cloud.gateway.routes[0].predicates[0].args.regexp=mycookievalue']);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user