From f56c6071df1aed1eef7d0214687b4241b76dfc7c Mon Sep 17 00:00:00 2001 From: Sjur Sutterud Sagen Date: Tue, 9 Apr 2024 15:28:04 +0200 Subject: [PATCH] Create ci-tests.yml for running tests in pipeline (#105) * Create ci-tests.yml for running tests in pipeline * PXWEB2-166 Add command for running tests in all projects (#104) Since we need to run tests easily, in various places, we need a script for running all tests easily. Co-authored-by: Kent Mossbaeck <> Co-authored-by: Michael Pande <> Co-authored-by: Per Inge Vaaje <60141320+PerIngeVaaje@users.noreply.github.com> Co-authored-by: Mikael Nordberg <54406826+MikaelNordberg@users.noreply.github.com> * Delete old, failing test from app --- .github/workflows/ci-tests.yml | 30 ++++++++++++++++++++++++++++++ apps/pxweb2/src/app/app.spec.tsx | 5 ----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci-tests.yml 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(); - }); });