Bug 39877: Merge vue and js tidy tests
Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
4971ed8d68
commit
7869584c98
17
xt/js_tidy.t
17
xt/js_tidy.t
|
|
@ -1,4 +1,4 @@
|
|||
#/usr/bin/perl
|
||||
#!/usr/bin/perl
|
||||
|
||||
# This file is part of Koha.
|
||||
#
|
||||
|
|
@ -20,13 +20,20 @@ use File::Slurp qw( read_file );
|
|||
use Test::More;
|
||||
use Test::NoWarnings;
|
||||
|
||||
my @js_files = qx{git ls-files '*.js' '*.ts'};
|
||||
use Koha::Devel::CI::IncrementalRuns;
|
||||
|
||||
plan tests => scalar(@js_files) + 1;
|
||||
my $ci = Koha::Devel::CI::IncrementalRuns->new( { context => 'tidy' } );
|
||||
|
||||
foreach my $filepath (@js_files) {
|
||||
my @files = $ci->get_files_to_test('js');
|
||||
|
||||
plan tests => scalar @files + 1;
|
||||
|
||||
my %results;
|
||||
foreach my $filepath (@files) {
|
||||
chomp $filepath;
|
||||
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath};
|
||||
my $content = read_file $filepath;
|
||||
ok( $content eq $tidy, "$filepath should be kept tidy" );
|
||||
ok( $content eq $tidy, "$filepath should be kept tidy" ) or $results{$filepath} = 1;
|
||||
}
|
||||
|
||||
$ci->report_results( \%results );
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# This file is part of Koha.
|
||||
#
|
||||
# Koha is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Koha is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Koha; if not, see <https://www.gnu.org/licenses>.
|
||||
|
||||
use Modern::Perl;
|
||||
use File::Slurp qw( read_file );
|
||||
use Test::More;
|
||||
use Test::NoWarnings;
|
||||
|
||||
my @vue_files = `git ls-files 'koha-tmpl/intranet-tmpl/prog/js/vue/*.vue'`;
|
||||
|
||||
plan tests => scalar(@vue_files) + 1;
|
||||
|
||||
foreach my $filepath (@vue_files) {
|
||||
chomp $filepath;
|
||||
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath};
|
||||
my $content = read_file $filepath;
|
||||
ok( $content eq $tidy, "$filepath should be kept tidy" );
|
||||
}
|
||||
Loading…
Reference in New Issue