diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/run-tests.yaml similarity index 75% rename from .github/workflows/integration-tests.yaml rename to .github/workflows/run-tests.yaml index d69b5c670..9e6c34b13 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -1,4 +1,4 @@ -name: Integration tests +name: Run tests on: push: branches: @@ -20,16 +20,27 @@ jobs: - name: yarn install run: | yarn install - - name: Run tests + - name: Integration tests run: | cd integration-tests yarn test:ci # yarn wait:ci + - name: Filter parser tests + run: | + cd packages/filterparser + yarn test:ci - uses: tanmen/jest-reporter@v1 if: always() with: github-token: ${{ secrets.GITHUB_TOKEN }} result-file: integration-tests/result.json + action: Integration tests + - uses: tanmen/jest-reporter@v1 + if: always() + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + result-file: packages/filterparser/result.json + action: Filter parser tests services: postgres: diff --git a/packages/filterparser/package.json b/packages/filterparser/package.json index 0a471998e..9b8a82c74 100644 --- a/packages/filterparser/package.json +++ b/packages/filterparser/package.json @@ -6,7 +6,8 @@ "scripts": { "build": "tsc", "start": "tsc --watch", - "test": "jest" + "test": "jest", + "test:ci": "jest --json --outputFile=result.json --testLocationInResults" }, "files": [ "lib" diff --git a/packages/filterparser/src/parserFilter.test.ts b/packages/filterparser/src/parserFilter.test.ts index 0c6af83ed..cc99fbd09 100644 --- a/packages/filterparser/src/parserFilter.test.ts +++ b/packages/filterparser/src/parserFilter.test.ts @@ -3,5 +3,9 @@ import { parseFilter } from './parseFilter'; test('parse string', () => { const ast = parseFilter('"123"', 'string'); console.log(JSON.stringify(ast)); - expect(ast).toBe(3); + expect(ast).toEqual({ + conditionType: 'like', + left: { exprType: 'placeholder' }, + right: { exprType: 'value', value: '%123%' }, + }); });