class TestLauncher::Frameworks::Mochajs::Runner

Public Instance Methods

by_line_number(test_case) click to toggle source
# File lib/test_launcher/frameworks/mochajs.rb, line 75
def by_line_number(test_case)
  if test_case.example
    single_example(test_case, exact_match: true)
  else
    single_file(test_case)
  end
end
multiple_examples_same_file(test_cases) click to toggle source
# File lib/test_launcher/frameworks/mochajs.rb, line 87
def multiple_examples_same_file(test_cases)
  test_case = test_cases.first
  single_example(test_case)
end
multiple_examples_same_root(test_cases) click to toggle source
# File lib/test_launcher/frameworks/mochajs.rb, line 92
def multiple_examples_same_root(test_cases)
  %{cd #{test_cases.first.app_root} && npm run test #{test_cases.map(&:file).join(" ")} -- --grep #{Shellwords.escape(test_cases.first.example)}}
end
one_or_more_files(test_cases) click to toggle source
# File lib/test_launcher/frameworks/mochajs.rb, line 96
def one_or_more_files(test_cases)
  %{cd #{test_cases.first.app_root} && npm run test #{test_cases.map(&:file).join(" ")}}
end
single_example(test_case, **_) click to toggle source
# File lib/test_launcher/frameworks/mochajs.rb, line 83
def single_example(test_case, **_)
  multiple_examples_same_root([test_case])
end