jest.dontMock('../index')

describe('get-element', () => {
  it('get elements by class from document', () => {
    const el = require('../index')
    document.body.innerHTML = `
      <div class="one"></div>
      <div></div>
    `
    expect(el.withClass('one').length).toEqual(1)
    expect(el.withTag('div').length).toEqual(2)
  })
  it('include inline', () => {
    document.body.innerHTML = `
      <script src="index.js"></script>
    `
    // const module = undefined
    const el = require('../index')
    console.log(el)
    expect(document.body.innerHTML.getElement.withTag('script').length).toEqual(1)
  })
})

/* globals jest, expect */

@@ -1,186 +1,495 @@
-jest.dontMock('../index')%0A%0Adescribe('get-element', () =%3E %7B%0A  it('get elements by class from document', () =%3E %7B%0A    const el = require('../index')%0A    document.body.innerHTML = %60%0A    
+//----------------------------------------------------------%0A// setup%0A//----------------------------------------------------------%0Ajest.dontMock('../index')%0Aconst el = require('../index')%0A%0A// jsdom page%0Adocument.body.innerHTML = %60%0A  %3Csection class=%22one%22%3E%3C/section%3E%0A  %3Carticle class=%22two%22%3E%3C/article%3E%0A  %3Carticle class=%22two%22%3E%3C/article%3E%0A  %3Cdiv class=%22root%22%3E%0A    %3Cspan class=%22root__one%22%3E%3C/span%3E%0A    %3Cdiv class=%22root__two%22%3E%3C/div%3E%0A    %3Cdiv class=%22root__two%22%3E%3C/div%3E%0A  %3C/div%3E%0A  %3C!-- red herrings --%3E%0A
   %3Cd
@@ -494,24 +494,30 @@
 %3Cdiv class=%22
+root__
 one%22%3E%3C/div%3E%0A
@@ -522,91 +522,613 @@
 %3E%0A  
-    %3Cdiv%3E%3C/div%3E%0A    %60%0A    expect(el.withCl
+%3Cdiv class=%22root__two%22%3E%3C/div%3E%0A%60%0A%0A// helper function%0Afunction testCases(cases, fn) %7B%0A  cases.map((testCase, i) =%3E %7B%0A    it(%60case: $%7BtestCase%7D%60, () =%3E %7B%0A      expect(fn(testCase)).toEqual(i)%0A    %7D)%0A  %7D)%0A%7D%0A%0A//----------------------------------------------------------%0A// tests%0A//----------------------------------------------------------%0Adescribe('get element with class from document', () =%3E %7B%0A  testC
 as
+e
 s(
-'one').length).toEqual(1)%0A    expect(
+%0A    %5B'none', 'one', 'two'%5D,%0A    testClass =%3E el.withClass(testClass).length%0A  )%0A%7D)%0A%0Adescribe('get element with tag from document', () =%3E %7B%0A  testCases(%0A    %5B'p', 'section', 'article'%5D,%0A    testTag =%3E 
 el.w
@@ -1138,21 +1138,23 @@
 Tag(
-'div'
+testTag
 ).length
 ).to
@@ -1153,307 +1153,459 @@
 ngth
-).toEqual(2)
 %0A  
+)%0A
 %7D)%0A
-  it('include inline', () =%3E %7B%0A    document.body.innerHTML = %60%0A      %3Cscript src=%22index.js%22%3E%3C/script%3E%0A    %60%0A    // const module = undefined%0A    const el = require('../index')%0A
+%0Adescribe('get element with class from element', () =%3E %7B%0A  testCases(%0A    %5B'none', 'root__one', 'root__two'%5D,%0A    testClass =%3E %7B%0A      const root = el.withClass('root')%5B0%5D%0A      return el.withClass(testClass, root).length%0A    %7D%0A  )%0A%7D)%0A%0Adescribe('get element with tag from element', () =%3E %7B%0A  testCases(%0A    %5B'p', 'span', 'div'%5D,%0A    testTag =%3E %7B%0A 
     
+ 
 cons
-ole.log(el)%0A    expect(document.body.innerHTML.getElement.withTag('script').length).toEqual(1)%0A  %7D
+t root = el.withClass('root')%5B0%5D%0A      return el.withTag(testTag, root).length%0A    %7D%0A  
 )%0A%7D)

write tests in jest