Skip to content

Commit 15b5742

Browse files
committed
Enhance ESLint configuration and testing setup for React components
- Updated ESLint configuration to allow JSX files with .jsx extension. - Modified test script in package.json to include .jsx files in the test suite. - Added new unit tests for the Alert component, covering rendering, className application, inline styles, children rendering, type classes, elevation, and closeable functionality.
1 parent 0e65976 commit 15b5742

3 files changed

Lines changed: 2 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [20]
11+
node-version: [20.9.0]
1212

1313
steps:
1414
- uses: actions/checkout@v4

packages/react-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"prepare": "npm run build",
1212
"complexity": "es6-plato -r -d complexity source/react && open ./complexity/index.html",
1313
"watch": "nodemon --watch source -x \"npm run build\"",
14-
"test": "nyc --require=./test/jsdom.js --reporter=html mocha --require @babel/register --require core-js --require regenerator-runtime/runtime --extension ['.js', '.jsx'] --recursive 'test/**/*.{js,jsx}' --exit",
14+
"test": "nyc --require=./test/jsdom.js --reporter=html mocha --require @babel/register --require core-js --require regenerator-runtime/runtime --recursive --exit",
1515
"lint": "npm run js-lint && npm run scss-lint",
1616
"js-lint": "eslint --quiet 'source/react/**/*.js'",
1717
"scss-lint": "stylelint 'source/scss/**/*.scss'",

packages/react-components/test/alert/Alert.jsx renamed to packages/react-components/test/alert/Alert.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ describe('<Alert />', () => {
99
it('should render without blowing up', () => {
1010
const wrapper = shallow(<Alert />);
1111

12-
expect(false).to.equal(true);
13-
1412
expect(wrapper.length).to.eql(1);
1513
});
1614

0 commit comments

Comments
 (0)