From 31e90c0ce608564a77fd83cebdfe4d8f1ce0c834 Mon Sep 17 00:00:00 2001 From: Landon Wilkins Date: Fri, 17 Jun 2016 06:58:59 -0600 Subject: [PATCH] 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 Product-Review: Jon Jensen QA-Review: Jon Jensen Tested-by: Jenkins --- gems/tatl_tael/lib/tatl_tael/linter.rb | 5 +++-- gems/tatl_tael/spec/linter_spec.rb | 7 +++++++ script/tatl_tael | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gems/tatl_tael/lib/tatl_tael/linter.rb b/gems/tatl_tael/lib/tatl_tael/linter.rb index d72479132a7..11babbb31e7 100644 --- a/gems/tatl_tael/lib/tatl_tael/linter.rb +++ b/gems/tatl_tael/lib/tatl_tael/linter.rb @@ -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? && diff --git a/gems/tatl_tael/spec/linter_spec.rb b/gems/tatl_tael/spec/linter_spec.rb index cc08ffd152a..5fa983b6fad 100644 --- a/gems/tatl_tael/spec/linter_spec.rb +++ b/gems/tatl_tael/spec/linter_spec.rb @@ -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 diff --git a/script/tatl_tael b/script/tatl_tael index b7823f53c53..e8f4eb069d1 100755 --- a/script/tatl_tael +++ b/script/tatl_tael @@ -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