Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ jobs:
- name: Install dependencies
run: yarn install

# Build assets
- run: yarn build
- run: npm pack
- name: Compile assets bundle
run: yarn build
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Pack bundle tarball
run: npm pack

- name: Create Release
id: create_release
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -25,3 +27,29 @@ jobs:

- name: Test
run: yarn test

- name: Upload coverage to OtterWise
if: ${{ !cancelled() && process.env.OTTERWISE_ENABLED == 'true' }}
uses: getOtterWise/github-action@v1
with:
token: ${{ secrets.OTTERWISE_TOKEN }}

- name: Upload coverage to Coveralls
if: ${{ !cancelled() && process.env.COVERALLS_ENABLED == 'true' }}
uses: coverallsapp/github-action@v2
with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
format: lcov
file: ./coverage/lcov.info

- name: Upload coverage to Codecov
if: ${{ !cancelled() && process.env.CODECOV_ENABLED == 'true' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() && process.env.CODECOV_ENABLED == 'true' }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ yarn-debug.log*
yarn-error.log*
*.mp4
/DS/.idea
/junit.xml
10 changes: 10 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
const path = require('path');
const { codecovWebpackPlugin } = require("@codecov/webpack-plugin");

module.exports = function({ config }) {
config.plugins = config.plugins || [];
config.plugins.push(
codecovWebpackPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "design-system",
uploadToken: process.env.CODECOV_TOKEN,
}),
);

config.module.rules.push({
test: /\.scss$/,
use: [
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: [
"text",
"lcov",
],

// An object that configures minimum threshold enforcement for coverage results
Expand Down Expand Up @@ -98,7 +99,9 @@ module.exports = {
// projects: null,

// Use this configuration option to add custom reporters to Jest
// reporters: undefined,
reporters: [
'jest-junit',
],

// Automatically reset mock state between every test
// resetMocks: false,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@babel/runtime": "^7.28.4",
"@codecov/webpack-plugin": "^1.9.1",
"@eslint/compat": "^1.4.1",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.7.2",
Expand Down Expand Up @@ -145,6 +146,7 @@
"jest": "^29.7.0",
"jest-css-modules-transform": "^4.4.2",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"nodemon": "^3.1.10",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/Toast/__snapshots__/withToast.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`test withToast it can create a new Toast message 1`] = `
exports[`withToast() can create a new Toast message 1`] = `
[
<div
className="Alert Alert-success"
Expand Down
4 changes: 2 additions & 2 deletions src/Toast/withToast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function WrappedComponent() {
return <div />;
}

describe('test withToast', () => {
test('it can create a new Toast message', async () => {
describe('withToast()', () => {
it('can create a new Toast message', async () => {
const newMessage = 'This is just a test...';
const ComponentWithToast = withToast(WrappedComponent);
const toast = create(<ComponentWithToast />);
Expand Down
Loading