diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5a29255..67fdb30 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,15 +12,15 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: ['18'] + node: [20.x] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -29,7 +29,7 @@ jobs: npm run docs - name: Publish - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae6b192..53ebfcc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,11 +17,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -33,11 +33,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e388ba..4350639 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,13 +11,13 @@ jobs: name: Release / Node ${{ matrix.node }} strategy: matrix: - node: ['18'] + node: [20.x] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -26,7 +26,7 @@ jobs: npm run build - name: Create a release - run: npx semantic-release@^18.0.0 + run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index e36d70f..7e4cb2f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "@typescript-eslint/parser": "^5.0.0", "bundle-declarations-webpack-plugin": "^5.1.1", "chai": "^4.3.7", - "chai-uuid": "^1.0.6", "dotenv": "^16.3.1", "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", diff --git a/test/FormController.spec.ts b/test/FormController.spec.ts index bcd3dd9..29b9b96 100644 --- a/test/FormController.spec.ts +++ b/test/FormController.spec.ts @@ -22,28 +22,28 @@ describe('FormController', () => { it('.getForm()', async () => { const form = await hybridforms.forms.getForm( '3ee88190-749a-4c65-8437-e392f6eabf71', - '868aa759-8c9b-de3c-a3d9-1c29932b4e05' + '3bd1644a-e841-4e17-84f2-8bf2b28b04f1' ); expect(form).to.not.equal(null); - expect(form?.response?.version).to.equal(16); - expect(form?.response?.files?.length).to.equal(4); + expect(form?.response?.version).to.equal(11); + expect(form?.response?.files?.length).to.equal(6); }); it('.listFormFiles()', async () => { const files = await hybridforms.forms.listFormFiles( '3ee88190-749a-4c65-8437-e392f6eabf71', - '868aa759-8c9b-de3c-a3d9-1c29932b4e05' + '3bd1644a-e841-4e17-84f2-8bf2b28b04f1' ); expect(files).to.not.equal(null); expect(files?.response).to.be.an('array'); - expect(files?.response?.length).to.equal(4); + expect(files?.response?.length).to.equal(6); }); it('.getFormFile()', async () => { const file = await hybridforms.forms.getFormFile( '3ee88190-749a-4c65-8437-e392f6eabf71', - '868aa759-8c9b-de3c-a3d9-1c29932b4e05', - 'Basistest-Controls.pdf' + '3bd1644a-e841-4e17-84f2-8bf2b28b04f1', + 'Basistest-Controls_.pdf' ); expect(file).to.not.equal(null); expect(file?.response?.type).to.equal('application/pdf'); diff --git a/test/HybridFormsClient.spec.ts b/test/HybridFormsClient.spec.ts index 919fb9f..1d7b434 100644 --- a/test/HybridFormsClient.spec.ts +++ b/test/HybridFormsClient.spec.ts @@ -1,10 +1,7 @@ -import { expect, use } from 'chai'; -import chaiUuid from 'chai-uuid'; +import { expect } from 'chai'; import { createClient } from '../src'; import HybridFormsClient from '../src/HybridFormsClient'; -use(chaiUuid); - const hybridforms: HybridFormsClient = createClient({ baseUrl: process.env.HF_BASE_URL ?? '', clientId: '1', @@ -14,12 +11,14 @@ const hybridforms: HybridFormsClient = createClient({ describe('HybridFormsClient', () => { it('.request()', async () => { + const url = + (process.env.HF_BASE_URL as string) + '/api/app/gatewaydata'; const resp = await hybridforms.request({ - url: 'https://httpbin.org/uuid', + url, type: 'GET', responseType: 'json' }); expect(resp?.response).to.not.equal(null); - expect(resp?.response?.uuid).to.be.a.uuid('v4'); + expect(resp?.response?.product).to.equal('HybridForms Server'); }); });