Add transformer wrapper for yaml-jest to be compatible with v28,

following the hint at https://github.com/sumwatshade/jest-transform-yaml/issues/19#issuecomment-1232857013
This commit is contained in:
Dannon Baker
2022-12-07 06:33:37 -05:00
parent 6d3ad39bb2
commit 8693fcb41e
2 changed files with 16 additions and 3 deletions
+3 -3
View File
@@ -184,9 +184,9 @@ module.exports = {
transform: {
...tsjPreset.transform,
"^.+\\.js$": "babel-jest",
".*\\.(vue)$": "@vue/vue2-jest",
"\\.yml$": "yaml-jest",
"\\.txt$": "jest-raw-loader",
"^.*\\.(vue)$": "@vue/vue2-jest",
"^.+\\.ya?ml$": "<rootDir>/tests/jest/yaml-jest.js",
"^.+\\.txt$": "jest-raw-loader",
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
+13
View File
@@ -0,0 +1,13 @@
const transformer = require("yaml-jest").default
const newTransformer = {
...transformer,
process: function (...params) {
return {
code: transformer?.process(...params),
map: null,
}
},
}
module.exports = newTransformer