import {expect} from 'chai'
import {concat} from '../src/concat'

describe('concat()', () => {
  it('should iterate all elements of given iterables in order', () => {
    const result = concat([1, 2, 3], [4, 5, 6])
    expect([...result]).to.deep.equal([1, 2, 3, 4, 5, 6])
  })

  it('should be a variadic function', () => {
    const arg3 = concat([1, 2], [3, 4], [5, 6])
    const arg4 = concat([1, 2], [3, 4], [5, 6], [7, 8])

    expect([...arg3]).to.deep.equal([1, 2, 3, 4, 5, 6])
    expect([...arg4]).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8])
  })

  it('should immediately exit when no argument received', () => {
    const result = concat()
    expect([...result]).to.be.empty
  })

  it('should treat non-iterable values as single-element iterable', () => {
    const result = concat([1, 2], 3, [4, 5, 6])
    expect([...result]).to.deep.equal([1, 2, 3, 4, 5, 6])
  })
})

@@ -725,16 +725,18 @@
 lues as 
+a 
 single-e
@@ -871,12 +871,206 @@
 6%5D)%0A  %7D)
+%0A%0A  it('should treat null-ish values as a empty iterable', () =%3E %7B%0A    const result = concat(%5B1, 2%5D, null, 3, undefined, %5B4, 5, 6%5D)%0A    expect(%5B...result%5D).to.deep.equal(%5B1, 2, 3, 4, 5, 6%5D)%0A  %7D)
 %0A%7D)%0A

add test case for concat to properly handle nullish value