<commit_before>require_relative 'test_helper'

class BasicComponent < BrowserIO::Component
  config.name :basic
  config.html <<-HTML
    <!DOCTYPE html>
    <html>
      <body>
        <div id='foo'>bar</div>
      </body>
    </html>
  HTML
  config.dom do
    tmpl :foo, dom.find('#foo')
  end

  def foo
    'bar'
  end
end

class TestComponent < Minitest::Test
  def test_calling_basic_component
    assert_equal 'bar', bio(:basic).foo
  end

  def test_parsing_html
    assert_equal '<div id="foo">bar</div>', bio(:basic).tmpl(:foo).to_html
  end

  def test_returning_js
    ap bio(:basic, :render_js).foo
    assert bio(:basic, :render_js).foo[/opal/]
  end
end
<commit_msg>fixed test<commit_after>require_relative 'test_helper'

class BasicComponent < BrowserIO::Component
  config.name :basic
  config.html <<-HTML
    <!DOCTYPE html>
    <html>
      <body>
        <div id='foo'>bar</div>
      </body>
    </html>
  HTML
  config.dom do
    tmpl :foo, dom.find('#foo')
  end

  def foo
    'bar'
  end
end

class TestComponent < Minitest::Test
  def test_calling_basic_component
    assert_equal 'bar', bio(:basic).foo
  end

  def test_parsing_html
    assert_equal '<div id="foo">bar</div>', bio(:basic).tmpl(:foo).to_html
  end

  def test_returning_js
    assert bio(:basic, :js).foo[/Opal/]
  end
end

{'fraction_non_alphanumeric': 0.133434420015163, 'fraction_numerical': 0.0, 'mean_word_length': 3.2038216560509554, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1181663', 'n_tokens_mistral': 485, 'n_tokens_neox': 469, 'n_words': 108}