{"size": 769, "ext": "js", "max_stars_repo_path": "2017/js/day07/test/tower.test.js", "max_stars_repo_name": "dynamoxteam/advent-of-code", "max_stars_repo_stars_event_min_datetime": "2018-01-26T15:04:50.000Z", "max_stars_repo_stars_event_max_datetime": "2018-02-19T14:10:03.000Z", "max_issues_repo_path": "2017/js/day07/test/tower.test.js", "max_issues_repo_name": "dynamoxteam/advent-of-code", "max_issues_repo_issues_event_min_datetime": "2018-01-23T12:03:54.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-08T15:55:33.000Z", "max_forks_repo_path": "2017/js/day07/test/tower.test.js", "max_forks_repo_name": "dynamoxteam/advent-of-code", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 24.03125, "max_line_length": 71, "alphanum_fraction": 0.5201560468}
import { expect } from 'chai'
import { parse } from '../src/tower'

/* global describe, it */

describe('tower', () => {
  describe('parse', () => {
    it('Should implement a parse method', () => {
      expect(parse).to.be.a('function')
    })

    it('Should parse "rxivjo (206) -> mewof, hrncqs, qgfstpq"', () => {
      const programData = 'rxivjo (206) -> mewof, hrncqs, qgfstpq'

      expect(parse(programData)).to.be.deep.equal({
        name: 'rxivjo',
        weight: 206,
        sub: ['mewof', 'hrncqs', 'qgfstpq']
      })
    })

    it('Should parse "jlbcwrl (93)"', () => {
      const programData = 'jlbcwrl (93)'

      expect(parse(programData)).to.be.deep.equal({
        name: 'jlbcwrl',
        weight: 93,
        sub: []
      })
    })
  })
})