old_contents: import test from 'ava';
  import validation from '../lib/validation';
  
  const input = {
    target: {
      name: 'boolean',
      value: 'foo bar baz',
    },
    all: {
      boolean: 'foo bar baz',
    },
  };
  
  const settings = {
    target: {
      empty: false,
    },
    all: {
      boolean: {
        empty: false,
      },
    },
  };
  
  
  // Valid input
  test('valid input', t => {
    t.true(validation(input, settings), 'Valid input returns true');
  });
  
new_contents: import test from 'ava';
  import validation from '../lib/validation';
  
  test('Empty Input', t => {
    const input = {
      target: {
        name: 'file',
        value: '',
      },
      all: {
        file: '',
      },
    };
  
    const settings = {
      target: {
        types: [
          '*',
        ],
      },
      all: {
        file: {
          types: [
            '*',
          ],
        },
      },
    };
  
    t.true(validation(input, settings), 'Empty input returns true');
  });
  
  test('Valid Input - All Accepted', t => {
    const input = {
      target: {
        name: 'file',
        value: 'punchcard.svg',
      },
      all: {
        file: 'punchcard.svg',
      },
    };
  
    const settings = {
      target: {
        types: [
          '*',
        ],
      },
      all: {
        file: {
          types: [
            '*',
          ],
        },
      },
    };
  
    t.true(validation(input, settings), 'Valid input returns true');
  });
  
  test('Valid Input - Single Type Accepted', t => {
    const input = {
      target: {
        name: 'file',
        value: 'punchcard.svg',
      },
      all: {
        file: 'punchcard.svg',
      },
    };
  
    const settings = {
      target: {
        types: [
          '.svg',
        ],
      },
      all: {
        file: {
          types: [
            '.svg',
          ],
        },
      },
    };
  
    t.true(validation(input, settings), 'Valid input returns true');
  });
  
  test('Valid Input - Multiple Types Accepted', t => {
    const input = {
      target: {
        name: 'file',
        value: 'punchcard.svg',
      },
      all: {
        file: 'punchcard.svg',
      },
    };
  
    const settings = {
      target: {
        types: [
          '.svg',
          '.jpeg',
        ],
      },
      all: {
        file: {
          types: [
            '.svg',
            '.jpeg',
          ],
        },
      },
    };
  
    t.true(validation(input, settings), 'Valid input returns true');
  });
  
  test('Invalid Input - Single Types Accepted', t => {
    const input = {
      target: {
        name: 'file',
        value: 'punchcard.png',
      },
      all: {
        file: 'punchcard.png',
      },
    };
  
    const settings = {
      target: {
        types: [
          '.svg',
        ],
      },
      all: {
        file: {
          types: [
            '.svg',
          ],
        },
      },
    };
  
    t.is(validation(input, settings), 'Invalid extension \'.png\'. Valid extensions are \'.svg\'', 'Invalid input returns with string');
  });
  
  test('Invalid Input - Multiple Types Accepted', t => {
    const input = {
      target: {
        name: 'file',
        value: 'punchcard.png',
      },
      all: {
        file: 'punchcard.png',
      },
    };
  
    const settings = {
      target: {
        types: [
          '.svg',
          '.jpeg',
        ],
      },
      all: {
        file: {
          types: [
            '.svg',
            '.jpeg',
          ],
        },
      },
    };
  
    t.is(validation(input, settings), 'Invalid extension \'.png\'. Valid extensions are \'.svg, .jpeg\'', 'Invalid input returns with string');
  });
  
subject: Add Validation Tests