Browse Source

fix(conf): add package.json of tested module to the graph cache key

zaverden 1 year ago
parent
commit
a3dcbdad28
1 changed files with 5 additions and 3 deletions
  1. 5 3
      build/conf/ts/ts_test.conf

+ 5 - 3
build/conf/ts/ts_test.conf

@@ -18,7 +18,7 @@ TS_TEST_JEST_CMD=$TOUCH_UNIT \
 ###
 ### @example
 ###
-###     TS_TEST_JEST_FOR(../)
+###     TS_TEST_JEST_FOR(path/to/module)
 ###         TS_TEST_SRCS(../src)
 ###         TS_TEST_CONFIG(../jest.config.js)
 ###     END()
@@ -59,8 +59,10 @@ module _TS_TEST_BASE: _BARE_UNIT {
     DISABLE(TS_CONFIG_DEDUCE_OUT)
 }
 
-macro _TS_TEST_FOR_ARGS(FOR_MOD) {
-    SET(TS_TEST_FOR_MOD $FOR_MOD)
+macro _TS_TEST_FOR_ARGS(FOR_MOD, RELATIVE?"${CURDIR}":"${ARCADIA_ROOT}") {
+    # we read testing modules' package.json during configuration,
+    # so we have to include it to configuration cache key
+    SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS $RELATIVE/$FOR_MOD/package.json)
     _SET_TS_TEST_FOR_VARS($FOR_MOD)
 }