diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6da5a43 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,23 @@ +name: Tests +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + test: + name: 'Test' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: Install dependencies + run: npm ci + - name: Build spatial + run: npm run build + - name: Start test app and run tests + run: | + npm run test-app:start & + npm run cypress:run diff --git a/.npmrc b/.npmrc index f767fb8..77aadd4 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,4 @@ save-exact=true +auto-install-peers = true @salutejs:registry=https://registry.npmjs.org/ //registry.npmjs.org/:_authToken=${NPM_REGISTRY_TOKEN} diff --git a/cypress.config.ts b/cypress.config.ts index c8f0ad4..7573d22 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'cypress'; export default defineConfig({ + video: false, e2e: { baseUrl: 'http://localhost:1234', }, diff --git a/package.json b/package.json index 113cba2..5531127 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "docs:build": "typedoc src/index.ts", "docs:serve": "http-server ./docs -c-1", "test-app:start": "rm -rf dist-test-app .parcel-cache && parcel ./tests/pages/**/*.html --dist-dir dist-test-app --no-cache", - "test-app:build": "parcel build ./tests/pages/**/*.html --dist-dir dist-test-app --no-cache", "cypress:open": "cypress open", + "cypress:run": "cypress run", "release": "git diff && auto shipit" }, "browserslist": [