Skip to content

Instantly share code, notes, and snippets.

@pporche87
Last active April 18, 2017 01:03
Show Gist options
  • Save pporche87/1a3bd8e82c4271e60b99dc48f512762a to your computer and use it in GitHub Desktop.
Save pporche87/1a3bd8e82c4271e60b99dc48f512762a to your computer and use it in GitHub Desktop.
let expect = require ('chai').expect
let slice = require ('../src/slice')
describe('slice()', () => {
it('Creates a slice of array from start up to but now including end', () => {
expect(slice(['1', '2', '3', '4', '5'], 1, 3)).to.deep.equal(['2','3'])
expect(slice([1, 2, 3, 4, 5], 1, 3)).to.deep.equal([2, 3])
expect(slice([1, '2', [3], 4, 5], 1, 3)).to.deep.equal(['2', [3]])
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment