text: import filter from '../src/filter'
  
  const dog1 = {
    first: 'Koira',
    second: 'Musta'
  }
  
  const dog2 = {
    first: 'Koira',
    second: 'Vihreä'
  }
  
  const cat1 = {
    first: 'Kissa',
    second: 'Ruskea'
  }
  
  const cat2 = {
    first: 'Kissa',
    second: 'Valkoinen'
  }
  
  const cat3 = {
    first: 'Kissa',
    second: 'Sininen'
  }
  
  const testArray = [dog1, dog2, cat1, cat2, cat3]
  
  describe('filter.js', () => {
    test('All-true filter', () => {
      expect(filter(testArray, () => true)).toEqual(testArray)
    })
  
    test('All-false filter', () => {
      expect(filter(testArray, () => false)).toEqual([])
    })
  
    test('Non-object filter', () => {
      const testStringArray = [
        'Kielikeskus',
        'Omena',
        'Koira',
        'Korttikotelo',
        'Joulukalenteri',
        'Valkokangas'
      ]
  
      expect(filter(testStringArray, s => s.startsWith('Ko'))).toEqual(['Koira', 'Korttikotelo'])
    })
  
    test('Object property filter', () => {
      expect(filter(testArray, o => o.first === 'Koira')).toEqual([dog1, dog2])
    })
  
    test('Multiple object property filter', () => {
      expect(filter(testArray, o => o.first === 'Kissa' && o.second === 'Sininen')).toEqual([cat3])
    })
  
    test('Null array', () => {
      expect(filter(null, () => true)).toEqual([])
    })
  })
  