all.js 498 B

123456789101112131415161718192021
  1. const testFile = require('../../helpers/testFile');
  2. const runTest = require('../../helpers/runTest');
  3. const cases = {
  4. valid: [testFile('valid.jsx')],
  5. invalid: [
  6. { ...testFile('invalid.jsx'), errors: 15 },
  7. {
  8. code: `export const validationSchema = Yup.object({
  9. email: Yup
  10. .string()
  11. .email('hello')
  12. .required('world'),
  13. })`,
  14. options: [{ mode: 'all' }],
  15. errors: 2,
  16. },
  17. ],
  18. };
  19. runTest('no-literal-string: mode all', cases);