{"action":"closed","issue":{"url":"https://api.github.com/repos/jquense/yup/issues/206","repository_url":"https://api.github.com/repos/jquense/yup","labels_url":"https://api.github.com/repos/jquense/yup/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/jquense/yup/issues/206/comments","events_url":"https://api.github.com/repos/jquense/yup/issues/206/events","html_url":"https://github.com/jquense/yup/issues/206","id":316901893,"number":206,"title":"Skip test if value don't exist","user":{"login":"khotey","id":37971386,"avatar_url":"https://avatars2.githubusercontent.com/u/37971386?v=4","gravatar_id":"","url":"https://api.github.com/users/khotey","html_url":"https://github.com/khotey","followers_url":"https://api.github.com/users/khotey/followers","following_url":"https://api.github.com/users/khotey/following{/other_user}","gists_url":"https://api.github.com/users/khotey/gists{/gist_id}","starred_url":"https://api.github.com/users/khotey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khotey/subscriptions","organizations_url":"https://api.github.com/users/khotey/orgs","repos_url":"https://api.github.com/users/khotey/repos","events_url":"https://api.github.com/users/khotey/events{/privacy}","received_events_url":"https://api.github.com/users/khotey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-23T17:09:21Z","updated_at":"2018-04-23T17:37:09Z","closed_at":"2018-04-23T17:37:09Z","author_association":"NONE","body":"I have category with url field, I use test function to test is url unique, but if it didn't pass is the option to skip test func, because otherwise it return `Url is required` and `Url already exist` ?\r\n\r\nexport const categorySchema = yup.object().shape({\r\n```\r\n  name: yup\r\n    .string()\r\n    .trim()\r\n    .typeError('Name must be a ${type}, but passed ${value}')\r\n    .required('Name is required'),\r\n  url: yup\r\n    .string()\r\n    .typeError('Url must be a ${type}, but passed ${value}')\r\n    .trim()\r\n    .required('Url is required')\r\n    .test('url', 'Url already exist', async (value) => {\r\n      if (!value) {\r\n        return false\r\n      }\r\n\r\n      const categoryByUrl = await knex('categories')\r\n        .first()\r\n        .where('url', value)\r\n\r\n      return !categoryByUrl\r\n    }),\r\n  enabled: yup.boolean(),\r\n})\r\n```"}}
{"actor":{"display_login":"jquense"}}