Make .each tests show the values being tested
This commit is contained in:
@@ -113,7 +113,7 @@ describe('CommonValidatorFunctions', () => {
|
||||
[{}, true],
|
||||
[{ a: 1 }, true],
|
||||
[{ a: undefined }, false],
|
||||
] as [any, boolean][])('isJsonSafe', (value, result) => {
|
||||
] as [any, boolean][])(`isJsonSafe %p ? %p`, (value, result) => {
|
||||
expect(CommonValidatorFunctions.isJsonSafe(value)).toBe(result);
|
||||
});
|
||||
|
||||
@@ -142,7 +142,7 @@ describe('CommonValidatorFunctions', () => {
|
||||
`${'a'.repeat(63)}.${'a'.repeat(63)}.${'a'.repeat(63)}.${'a'.repeat(62)}`,
|
||||
false,
|
||||
],
|
||||
])('isValidDnsSubdomain', (value, result) => {
|
||||
])(`isValidDnsSubdomain %p ? %p`, (value, result) => {
|
||||
expect(CommonValidatorFunctions.isValidDnsSubdomain(value)).toBe(result);
|
||||
});
|
||||
|
||||
@@ -158,7 +158,7 @@ describe('CommonValidatorFunctions', () => {
|
||||
['a_b', false],
|
||||
[`${'a'.repeat(63)}`, true],
|
||||
[`${'a'.repeat(64)}`, false],
|
||||
])('isValidDnsLabel', (value, result) => {
|
||||
])(`isValidDnsLabel %p ? %p`, (value, result) => {
|
||||
expect(CommonValidatorFunctions.isValidDnsLabel(value)).toBe(result);
|
||||
});
|
||||
|
||||
@@ -170,7 +170,7 @@ describe('CommonValidatorFunctions', () => {
|
||||
['a_b', 'ab'],
|
||||
[`${'a'.repeat(6000)}`, `${'a'.repeat(6000)}`],
|
||||
['_:;>!"#€', ''],
|
||||
])('normalizeToLowercaseAlphanum', (value, result) => {
|
||||
])(`normalizeToLowercaseAlphanum %p ? %p`, (value, result) => {
|
||||
expect(CommonValidatorFunctions.normalizeToLowercaseAlphanum(value)).toBe(
|
||||
result,
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
],
|
||||
[`a/${'a'.repeat(63)}`, true],
|
||||
[`a/${'a'.repeat(64)}`, false],
|
||||
])('isValidApiVersion', (value, matches) => {
|
||||
])(`isValidApiVersion %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidApiVersion(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
['a'.repeat(63), true],
|
||||
['a'.repeat(64), false],
|
||||
['a-b', false],
|
||||
])('isValidKind', (value, matches) => {
|
||||
])(`isValidKind %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidKind(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
['a--b', false],
|
||||
['a_b', true],
|
||||
['a.b', true],
|
||||
])('isValidObjectName', (value, matches) => {
|
||||
])(`isValidObjectName %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidObjectName(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -98,7 +98,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
['a--b', false],
|
||||
['a_b', false],
|
||||
['a.b', false],
|
||||
])('isValidNamespace', (value, matches) => {
|
||||
])(`isValidNamespace %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidNamespace(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -134,7 +134,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
],
|
||||
[`a/${'a'.repeat(63)}`, true],
|
||||
[`a/${'a'.repeat(64)}`, false],
|
||||
])('isValidLabelKey', (value, matches) => {
|
||||
])(`isValidLabelKey %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidLabelKey(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
['a--b', false],
|
||||
['a_b', true],
|
||||
['a.b', true],
|
||||
])('isValidLabelValue', (value, matches) => {
|
||||
])(`isValidLabelValue %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidLabelValue(value)).toBe(matches);
|
||||
});
|
||||
|
||||
@@ -189,7 +189,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
],
|
||||
[`a/${'a'.repeat(63)}`, true],
|
||||
[`a/${'a'.repeat(64)}`, false],
|
||||
])('isValidAnnotationKey', (value, matches) => {
|
||||
])(`isValidAnnotationKey %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidAnnotationKey(value)).toBe(
|
||||
matches,
|
||||
);
|
||||
@@ -201,7 +201,7 @@ describe('KubernetesValidatorFunctions', () => {
|
||||
['', true],
|
||||
['a', true],
|
||||
['/'.repeat(6000), true],
|
||||
])('isValidAnnotationValue', (value, matches) => {
|
||||
])(`isValidAnnotationValue %p ? %p`, (value, matches) => {
|
||||
expect(KubernetesValidatorFunctions.isValidAnnotationValue(value)).toBe(
|
||||
matches,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user