{"size": 923, "ext": "js", "max_stars_repo_path": "test/superpipe.test.js", "max_stars_repo_name": "lsm/superpipe", "max_stars_repo_stars_event_min_datetime": "2015-08-03T17:19:57.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-09T18:31:52.000Z", "max_issues_repo_path": "test/superpipe.test.js", "max_issues_repo_name": "lsm/superplumber", "max_issues_repo_issues_event_min_datetime": "2015-11-02T23:37:47.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T02:46:48.000Z", "max_forks_repo_path": "test/superpipe.test.js", "max_forks_repo_name": "lsm/superplumber", "max_forks_repo_forks_event_min_datetime": "2015-09-17T05:28:06.000Z", "max_forks_repo_forks_event_max_datetime": "2015-10-06T22:34:56.000Z"}
{"max_stars_count": 4, "max_issues_count": 5, "max_forks_count": 2, "avg_line_length": 26.3714285714, "max_line_length": 74, "alphanum_fraction": 0.5601300108}
/* globals describe, it */
import { expect } from 'chai'
import superpipe from '../src'

describe('Superpipe', function() {
  describe('superpipe()', function() {
    it('should create pipeline constructor', function() {
      let sp = superpipe()
      expect(sp).to.be.a('function')

      let pipeline = sp('my pipeline')
      expect(pipeline.end).to.be.a('function')
      expect(pipeline.pipe).to.be.a('function')
      expect(pipeline.error).to.be.a('function')
      expect(pipeline.input).to.be.a('function')
    })
  })

  describe('superpipe(deps)', function() {
    it('should use `deps` as dependencies when creating pipeline', () => {
      let deps = { key: 'value' }
      var sp = superpipe(deps)
      let pipeline = sp('key value pipeline')
        .pipe(
          key => {
            expect(key).to.equal(deps.key)
          },
          'key'
        )
        .end()
      pipeline()
    })
  })
})
