text: import filter from "../src/filter.js"
  
  /*
   * Iterates over elements of `array`, returning an array of all elements
   * `predicate` returns truthy for. The predicate is invoked with three
   * arguments: (value, index, array).
   * const users = [
   *   { 'user': 'barney', 'active': true },
   *   { 'user': 'fred',   'active': false }
   * ]
   *
   * filter(users, ({ active }) => active)
   * // => objects for ['barney']
   */
  
  
  describe("filter tests", () => {
  	test('filter should return objects for specified predicates, active in this case', () => {
  		const users = [
  			{ 'user': 'barney', 'active': true },
  			{ 'user': 'fred',   'active': false }
  		];
  		expect(filter(users, ({ active }) => active)).toStrictEqual([{'user': 'barney', 'active': true }]);
  	}),
  	test('filter should return empty array when no objects fit the filter', () => {
  		const users2 = [
  			{ 'user': 'barney', 'active': false },
  			{ 'user': 'fred',   'active': false }
  		];
  		expect(filter(users2, ({ active }) => active)).toStrictEqual([[]]);
  	})
  });
  