Skip to content

Commit

Permalink
Base for Typescript unit testing
Browse files Browse the repository at this point in the history
- Test that the redirect url hasn't change
  • Loading branch information
Marc-Antoine Hinse committed Nov 27, 2024
1 parent 334a038 commit 005f43a
Show file tree
Hide file tree
Showing 7 changed files with 3,573 additions and 94 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ inspect-tags:
.PHONY: test
test: venv-tools
venv-tools/bin/pytest ./packages/flare/tests/**/*.py -vv ;
yarn run test:ci

.PHONY: format setup-web
format: venv-tools
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"setup": "yarn && lerna run build",
"start": "lerna run start --stream --no-sort --concurrency 100",
"unlink": "cd packages/flare && node build.js unlink",
"link": "cd packages/flare && node build.js unlink && node build.js link"
"link": "cd packages/flare && node build.js unlink && node build.js link",
"test": "cd packages/react-components && yarn run test",
"test:ci": "cd packages/react-components && yarn run test:ci"
},
"devDependencies": {
"lerna": "^2.9.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/react-components/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': 'off',
},
env: {
jest: true
},
};
3 changes: 3 additions & 0 deletions packages/react-components/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testMatch: ['**/*.unit.[jt]s?(x)'],
};
9 changes: 8 additions & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"lint": "yarn run eslint && yarn run stylelint",
"lint:ci": "yarn run eslint:ci && yarn run stylelint",
"start": "webpack --watch",
"stylelint": "stylelint \"src/**/*.{ts,tsx}\" --config stylelint.config.js"
"stylelint": "stylelint \"src/**/*.{ts,tsx}\" --config stylelint.config.js",
"test": "jest",
"test:ci": "yarn run test --ci",
"test:watch": "jest --watch"
},
"exports": {
"./configuration-screen": "./ConfigurationScreen.js",
Expand All @@ -28,6 +31,7 @@
"@splunk/webpack-configs": "^7.0.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12",
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.0.0",
"babel-eslint": "^10.1.0",
Expand All @@ -42,13 +46,16 @@
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.7.0",
"lerna": "^8.1.9",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-test-renderer": "^16.12.0",
"shelljs": "^0.8.5",
"style-loader": "^4.0.0",
"styled-components": "^5.3.10",
"stylelint": "^13.0.0",
"ts-jest": "^29.2.5",
"typescript": "^4.3.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getRedirectUrl } from '../utils/setupConfiguration';

test('Flare Redirect URL', () => {
expect(getRedirectUrl()).toBe('/app/flare');
});
3,642 changes: 3,550 additions & 92 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 005f43a

Please sign in to comment.