allow jsx tests for coffee changes, fixes SD-1261

test plan:
* test commit

Change-Id: I9e3da787a56467c886d1e70f107b3abb916c6d1e
Reviewed-on: https://gerrit.instructure.com/82842
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
This commit is contained in:
Landon Wilkins 2016-06-17 06:58:59 -06:00
parent 0e46247dfe
commit 31e90c0ce6
3 changed files with 11 additions and 3 deletions

View File

@ -84,10 +84,12 @@ module TatlTael
end
COFFEE_SPEC_REGEX = /spec\/coffeescripts\//
JSX_SPEC_REGEX = /spec\/(coffeescripts|javascripts)\/jsx\//
def coffee_specs?
changes.any? do |change|
!change.deleted? &&
change.path =~ COFFEE_SPEC_REGEX
(change.path =~ COFFEE_SPEC_REGEX ||
change.path =~ JSX_SPEC_REGEX)
end
end
@ -99,7 +101,6 @@ module TatlTael
end
end
JSX_SPEC_REGEX = /spec\/(coffeescripts|javascripts)\/jsx\//
def jsx_specs?
changes.any? do |change|
!change.deleted? &&

View File

@ -79,6 +79,13 @@ describe TatlTael::Linter do
[{ path: APP_COFFEE_BUNDLE_PATH, deleted?: false }],
:ensure_coffee_specs
end
context "with jsx spec changes" do
include_examples "change combos",
APP_COFFEE_PATH,
JSX_SPEC_PATH,
:ensure_coffee_specs
end
end
end

View File

@ -64,7 +64,7 @@ end
linter.ensure_coffee_specs do
errors << "Your commit includes coffee changes,"\
" but does not include coffee specs."\
" but does not include coffee or jsx specs."\
" Please add some to verify your changes."
end