-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jest transform config (opensearch-project#497)
* add jest transform config Signed-off-by: Jackie Han <jkhanjob@gmail.com> * add license header Signed-off-by: Jackie Han <jkhanjob@gmail.com> * update file as .ts file Signed-off-by: Jackie Han <jkhanjob@gmail.com> * add comment on jest config file Signed-off-by: Jackie Han <jkhanjob@gmail.com> * add more comments Signed-off-by: Jackie Han <jkhanjob@gmail.com> * cleanup Signed-off-by: Jackie Han <jkhanjob@gmail.com> * update file export Signed-off-by: Jackie Han <jkhanjob@gmail.com> --------- Signed-off-by: Jackie Han <jkhanjob@gmail.com>
- Loading branch information
1 parent
b6b5d2a
commit af963a9
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/** | ||
* The transform configuration in Jest allows you to | ||
* specify custom transformation logic for specific file types during testing. | ||
*/ | ||
module.exports = { | ||
/** | ||
* This function is responsible for transforming the file. | ||
* @returns the string module.exports = {};, which is an empty CommonJS module. | ||
*/ | ||
process() { | ||
return { | ||
code: `module.exports = {};`, | ||
}; | ||
}, | ||
/** | ||
* The cache key helps Jest determine if a file needs to be retransformed or if it can use the cached transformation result. | ||
* @returns a unique string that serves as a cache key for the transformation. | ||
*/ | ||
getCacheKey() { | ||
return 'svgTransform'; | ||
}, | ||
}; |