votemike / react-accordion

A simple, extendable, accessible React accordion using semantic HTML.
https://votemike.github.io/react-accordion/
MIT License
1 stars 0 forks source link

Test different versions of React #5

Open markwylde opened 1 year ago

markwylde commented 1 year ago

So using a Github Action Matrix would help solve this.

Something like:

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index bedfb5f..fb48a49 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,6 +14,7 @@ jobs:
     strategy:
       matrix:
         node-version: [16.x, 18.x]
+        react-version: [17, 18]

     steps:
     - uses: actions/checkout@v2
@@ -24,6 +25,7 @@ jobs:
         node-version: ${{ matrix.node-version }}

     - run: npm install
+    - run: npm install react@${{ matrix.node-version }}
     - run: npm run build
     - run: npm run lint
     - run: npm test

But the issue is this changes the version of the React we are using in our project. What we really want to do is change the version of React being used in the demo.

We may need to add some e2e tests to the demo if we want to test this.

votemike commented 1 year ago

We want both don't we? Both to test the accordion works with this version of React (e.g. it won't work with React version before hooks) and also with the demo.

votemike commented 1 year ago

Also need to update the package.json to allow different version of React.