|
|
|
|
@ -14,9 +14,20 @@ See the License for the specific language governing permissions and |
|
|
|
|
limitations under the License. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
import { iterableDiff, iterableUnion } from "../../src/utils/iterables"; |
|
|
|
|
import { iterableDiff, iterableMerge, iterableUnion } from "../../src/utils/iterables"; |
|
|
|
|
|
|
|
|
|
describe('iterables', () => { |
|
|
|
|
describe('iterableMerge', () => { |
|
|
|
|
it('should return a merged array', () => { |
|
|
|
|
const a = [1, 2, 3]; |
|
|
|
|
const b = [1, 2, 4]; // note diff
|
|
|
|
|
const result = iterableMerge(a, b); |
|
|
|
|
expect(result).toBeDefined(); |
|
|
|
|
expect(result).toHaveLength(4); |
|
|
|
|
expect(result).toEqual([1, 2, 3, 4]); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('iterableUnion', () => { |
|
|
|
|
it('should return a union', () => { |
|
|
|
|
const a = [1, 2, 3]; |
|
|
|
|
|