TP-28649 | Testing Library Issue Fixed
This commit is contained in:
7
testTransformers/fileTransformer.js
Normal file
7
testTransformers/fileTransformer.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
process(src, filename, config, options) {
|
||||
return `module.exports = ${JSON.stringify(path.basename(filename))};`;
|
||||
},
|
||||
};
|
||||
14
testTransformers/scssTransformer.js
Normal file
14
testTransformers/scssTransformer.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
process(sourceText, sourcePath, options) {
|
||||
console.log('In transformer');
|
||||
const modifiedCode = sourceText.replace(
|
||||
'style-inject',
|
||||
'style-inject/dist/style-inject.es',
|
||||
);
|
||||
return {
|
||||
code: modifiedCode,
|
||||
};
|
||||
},
|
||||
};
|
||||
6
testTransformers/setupTests.js
Normal file
6
testTransformers/setupTests.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const util = require('util');
|
||||
const crypto = require('crypto');
|
||||
|
||||
global.TextEncoder = util.TextEncoder;
|
||||
global.TextDecoder = util.TextDecoder;
|
||||
global.crypto.randomUUID = crypto.randomUUID;
|
||||
Reference in New Issue
Block a user