1 package SL::Controller::JSTests;
 
   5 use parent qw(SL::Controller::Base);
 
  10 use SL::System::Process;
 
  12 use Rose::Object::MakeMethods::Generic
 
  14   'scalar --get_set_init' => [ qw(all_scripts scripts_to_run) ],
 
  24   $::request->layout->use_stylesheet("css/qunit.css");
 
  25   $self->render('js_tests/run', title => $::locale->text('Run JavaScript unit tests'));
 
  32 sub init_all_scripts {
 
  35   my $exe_dir = SL::System::Process->exe_dir;
 
  39     return if ( ! -f $File::Find::name ) || ($File::Find::name !~ m{\.js$});
 
  40     push @scripts, File::Spec->abs2rel($File::Find::name, $exe_dir);
 
  43   File::Find::find($wanted, $exe_dir . '/js/t');
 
  48 sub init_scripts_to_run {
 
  50   my $filter = $::form->{file_filter} || '.';
 
  51   return [ grep { m{$filter} } @{ $self->all_scripts } ];