diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 00000000..1ed450a9 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,30 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test diff --git a/apps/pxweb2/src/app/app.spec.tsx b/apps/pxweb2/src/app/app.spec.tsx index 2152cbdf..6f2c6642 100644 --- a/apps/pxweb2/src/app/app.spec.tsx +++ b/apps/pxweb2/src/app/app.spec.tsx @@ -7,9 +7,4 @@ describe('App', () => { const { baseElement } = render(); expect(baseElement).toBeTruthy(); }); - - it('should have a greeting as the title', () => { - const { getByText } = render(); - expect(getByText(/Welcome pxweb2/gi)).toBeTruthy(); - }); }); diff --git a/package.json b/package.json index 3222580a..62640a2d 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "npx nx run pxweb2:serve", "prebuild": "npm run build-style-dictionary", "build": "nx run pxweb2:build && nx run pxweb2-ui:build-storybook", + "test": "nx run-many -t test -p pxweb2 pxweb2-ui", "start-storybook": "npx nx run pxweb2-ui:storybook", "build-storybook": "npx nx run pxweb2-ui:build-storybook", "build-style-dictionary": "node libs/pxweb2-ui/style-dictionary/build.js",