mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 06:28:33 +00:00
collection runner tag updates
This commit is contained in:
@@ -310,8 +310,7 @@ const requestSchema = Yup.object({
|
||||
.nullable(),
|
||||
assertions: Yup.array().of(keyValueSchema).nullable(),
|
||||
tests: Yup.string().nullable(),
|
||||
docs: Yup.string().nullable(),
|
||||
tags: Yup.array().of(Yup.string().matches(/^[\w-]+$/, 'tag must be alphanumeric'))
|
||||
docs: Yup.string().nullable()
|
||||
})
|
||||
.noUnknown(true)
|
||||
.strict();
|
||||
@@ -356,6 +355,7 @@ const itemSchema = Yup.object({
|
||||
type: Yup.string().oneOf(['http-request', 'graphql-request', 'folder', 'js']).required('type is required'),
|
||||
seq: Yup.number().min(1),
|
||||
name: Yup.string().min(1, 'name must be at least 1 character').required('name is required'),
|
||||
tags: Yup.array().of(Yup.string().matches(/^[\w-]+$/, 'tag must be alphanumeric')),
|
||||
request: requestSchema.when('type', {
|
||||
is: (type) => ['http-request', 'graphql-request'].includes(type),
|
||||
then: (schema) => schema.required('request is required when item-type is request')
|
||||
|
||||
@@ -7,7 +7,8 @@ describe('Item Schema Validation', () => {
|
||||
const item = {
|
||||
uid: uuid(),
|
||||
name: 'A Folder',
|
||||
type: 'folder'
|
||||
type: 'folder',
|
||||
tags: ['smoke-test']
|
||||
};
|
||||
|
||||
const isValid = await itemSchema.validate(item);
|
||||
|
||||
@@ -9,7 +9,6 @@ describe('Request Schema Validation', () => {
|
||||
method: 'GET',
|
||||
headers: [],
|
||||
params: [],
|
||||
tags: ['smoke-test'],
|
||||
body: {
|
||||
mode: 'none'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user