Skip to content

Commit b4fae18

Browse files
authored
feat(tooling): add unit tests (#643)
1 parent d87aa93 commit b4fae18

6 files changed

Lines changed: 626 additions & 26 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,6 @@ jobs:
281281

282282
- name: Test CC Widgets
283283
run: yarn run test:cc-widgets
284+
285+
- name: Test Meetings Widget
286+
run: yarn run test:meetings-widget

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@
5151
"scripts": {
5252
"clean": "yarn workspaces foreach --all --topological --parallel run clean && rm -rf node_modules",
5353
"clean:dist": "yarn workspaces foreach --all --topological --parallel run clean:dist",
54-
"test:unit": "yarn run test:tooling && yarn run test:cc-widgets",
54+
"test:unit": "yarn run test:tooling && yarn run test:cc-widgets && yarn run test:meetings-widget",
5555
"test:e2e": "yarn playwright test",
5656
"test:styles": "yarn workspaces foreach --all --exclude webex-widgets run test:styles",
5757
"test:tooling": "jest --coverage",
5858
"test:cc-widgets": "yarn workspaces foreach --all --exclude webex-widgets --exclude samples-cc-wc-app --exclude samples-cc-react-app run test:unit",
59+
"test:meetings-widget": "yarn workspaces foreach --all --verbose --include @webex/widgets run test:unit",
5960
"build:dev": "NODE_ENV=development yarn build",
6061
"build:prod": "NODE_ENV=production yarn build:serial",
6162
"build": "NODE_OPTIONS=--max-old-space-size=4096 yarn workspaces foreach --all --parallel --topological --exclude samples-cc-react-app --exclude samples-cc-wc-app --exclude samples-meeting-app run build:src",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const jestConfig = require('../../../jest.config.js');
2+
3+
jestConfig.rootDir = '../../../';
4+
jestConfig.testMatch = ['**/@webex/widgets/tests/**/*.test.{js,jsx}'];
5+
jestConfig.globals = {
6+
...jestConfig.globals,
7+
__appVersion__: '1.0.0-test',
8+
};
9+
jestConfig.coveragePathIgnorePatterns = [
10+
...(jestConfig.coveragePathIgnorePatterns || []),
11+
'WebexLogo\\.jsx$',
12+
];
13+
14+
module.exports = jestConfig;

packages/@webex/widgets/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"release:debug": "semantic-release --debug",
1818
"release:dry-run": "semantic-release --dry-run",
1919
"start": "npm run demo:serve",
20+
"test:unit": "jest --config jest.config.js --coverage",
2021
"test:e2e": "npm run demo:build && wdio wdio.conf.js",
2122
"test:eslint": "echo 'Broken eslint tests'",
2223
"test:eslint:broken": "eslint src/"
@@ -57,6 +58,9 @@
5758
"@momentum-ui/react": "^23.21.4",
5859
"@semantic-release/changelog": "^6.0.0",
5960
"@semantic-release/git": "^10.0.0",
61+
"@testing-library/dom": "10.4.0",
62+
"@testing-library/jest-dom": "6.6.2",
63+
"@testing-library/react": "16.0.1",
6064
"@wdio/cli": "^7.3.1",
6165
"@wdio/jasmine-framework": "^7.4.6",
6266
"@wdio/junit-reporter": "^7.4.2",

0 commit comments

Comments
 (0)