text: let expect = require('chai').expect
  let jsdom = require('jsdom-global')()
  let $ = require('jquery')
  
  const StringBuilder = require('./b_StringBuilder')
  
  
  describe("StringBuilder Tests", function() {
      let builder
      beforeEach(function () {
          builder = new StringBuilder('test')
      })
      it("It should have initialized all methods", function() {
          expect(Object.getPrototypeOf(builder).hasOwnProperty('append')).to.be.equal(true)
          expect(Object.getPrototypeOf(builder).hasOwnProperty('prepend')).to.be.equal(true)
          expect(Object.getPrototypeOf(builder).hasOwnProperty('insertAt')).to.be.equal(true)
          expect(Object.getPrototypeOf(builder).hasOwnProperty('remove')).to.be.equal(true)
          expect(Object.getPrototypeOf(builder).hasOwnProperty('toString')).to.be.equal(true)
      });
  
  
      it("It should return same string", function() {
          expect(builder.toString()).to.be.equal('test')
      });
      it("It should return same string", function() {
          //s prazen string
          builder=new  StringBuilder()
          expect(builder.toString()).to.be.equal('')
      });
      it("It should throw error", function() {
          expect(()=> {builder=new  StringBuilder(5)}).to.throw(TypeError)
      });
      it("append", function() {
          builder.append(' func')
          expect(builder._stringArray.length).to.be.equal(9)
          expect(builder.toString()).to.be.equal('test func')
      });
      it("append error", function() {
          expect(()=> {builder.append({})}).to.throw(TypeError)
      });
      it("prepend", function() {
          builder.prepend('fu ')
          expect(builder._stringArray.length).to.be.equal(7)
          expect(builder.toString()).to.be.equal('fu test')
      });
      it("prepend error", function() {
          expect(()=> {builder.prepend({})}).to.throw(TypeError)
      });
      it("insertAt", function() {
          builder.insertAt('ab',2)
          expect(builder._stringArray.length).to.be.equal(6)
          expect(builder.toString()).to.be.equal('teabst')
      });
      it("insertAt error", function() {
          expect(()=> {builder.insertAt(55)}).to.throw(TypeError)
      });
      it("remove", function() {
          builder.remove(1,2)
          expect(builder._stringArray.length).to.be.equal(2)
          expect(builder.toString()).to.be.equal('tt')
      });
      it("remove error", function() {
          expect(()=> {builder.remove(s, 5)}).to.throw(ReferenceError)
      });
  });
  