Merge pull request #4 from navi-sa/TP-28649
TP-28649 | Testing Library Issue Fixed
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
module.exports = {
|
||||
testTimeout: 30000,
|
||||
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)'],
|
||||
testEnvironment: 'jsdom',
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)?$': 'ts-jest',
|
||||
'^.+\\.scss.js$': '<rootDir>/__tests__/scssTransformer.js',
|
||||
'^.+\\.scss.js?$': '<rootDir>/testTransformers/scssTransformer.js',
|
||||
},
|
||||
// setupFilesAfterEnv: ['./__tests__/setupTests.ts'],
|
||||
transformIgnorePatterns: [],
|
||||
setupFilesAfterEnv: ['<rootDir>/testTransformers/setupTests.js'],
|
||||
testPathIgnorePatterns: [
|
||||
'factory',
|
||||
'fileTransformer.js',
|
||||
@@ -14,10 +16,11 @@ module.exports = {
|
||||
'__mock__',
|
||||
'scssTransformer.js',
|
||||
],
|
||||
modulePathIgnorePatterns: ['<roodDir>/src/DMNSelfServeV2/'],
|
||||
globals: {},
|
||||
moduleNameMapper: {
|
||||
'\\.(scss|css|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/__tests__/fileTransformer.js',
|
||||
'<rootDir>/testTransformers/fileTransformer.js',
|
||||
'@navi/web-ui/(.*)': '<rootDir>/node_modules/@navi/web-ui',
|
||||
},
|
||||
verbose: false,
|
||||
verbose: true,
|
||||
};
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"axios": "^1.3.5",
|
||||
"chart.js": "^4.2.1",
|
||||
"classnames": "^2.3.2",
|
||||
"crypto": "^1.0.1",
|
||||
"eslint-loader": "3.0.3",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"formik": "^2.2.9",
|
||||
|
||||
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))};`;
|
||||
},
|
||||
};
|
||||
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;
|
||||
@@ -3160,6 +3160,11 @@ crypto-js@^4.1.1:
|
||||
resolved "https://nexus.cmd.navi-tech.in/repository/navi-commons/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf"
|
||||
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
|
||||
|
||||
crypto@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://nexus.cmd.navi-tech.in/repository/navi-commons/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037"
|
||||
integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==
|
||||
|
||||
css-loader@^6.7.3:
|
||||
version "6.7.3"
|
||||
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.7.3.tgz#1e8799f3ccc5874fdd55461af51137fcc5befbcd"
|
||||
|
||||
Reference in New Issue
Block a user