TP-28649 | RTL integration
This commit is contained in:
14
__tests__/scssTransformer.js
Normal file
14
__tests__/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,
|
||||
};
|
||||
},
|
||||
};
|
||||
23
jest.config.js
Normal file
23
jest.config.js
Normal file
@@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
testTimeout: 30000,
|
||||
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)'],
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)?$': 'ts-jest',
|
||||
'^.+\\.scss.js$': '<rootDir>/__tests__/scssTransformer.js',
|
||||
},
|
||||
// setupFilesAfterEnv: ['./__tests__/setupTests.ts'],
|
||||
testPathIgnorePatterns: [
|
||||
'factory',
|
||||
'fileTransformer.js',
|
||||
'Helper.ts',
|
||||
'setupTests.ts',
|
||||
'__mock__',
|
||||
'scssTransformer.js',
|
||||
],
|
||||
modulePathIgnorePatterns: ['<roodDir>/src/DMNSelfServeV2/'],
|
||||
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',
|
||||
},
|
||||
verbose: false,
|
||||
};
|
||||
@@ -22,6 +22,8 @@
|
||||
"@navi/web-ui": "^1.49.8",
|
||||
"@reduxjs/toolkit": "^1.9.4",
|
||||
"@super-app/dark-knight": "^1.0.6",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.10.0",
|
||||
"@typescript-eslint/parser": "^2.10.0",
|
||||
"axios": "^1.3.5",
|
||||
@@ -37,13 +39,15 @@
|
||||
"react-chartjs-2": "^5.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-redux": "^8.0.5",
|
||||
"react-router-dom": "^6.8.2"
|
||||
"react-router-dom": "^6.8.2",
|
||||
"ts-jest": "^29.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.21.0",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.21.0",
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/react-redux": "^7.1.25",
|
||||
"@typescript-eslint/eslint-plugin": "^2.10.0",
|
||||
@@ -64,6 +68,8 @@
|
||||
"eslint-plugin-react-hooks": "^2.3.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"husky": "^8.0.1",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"prettier": "^2.8.4",
|
||||
"sass": "^1.58.3",
|
||||
"sass-loader": "^13.2.0",
|
||||
|
||||
7
src/utils/__tests__/utils.test.tsx
Normal file
7
src/utils/__tests__/utils.test.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
describe('Temp Test', () => {
|
||||
it('Test Case 1', () => {
|
||||
expect('1').toBe('1');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user