mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
filterparser tests added to test run
This commit is contained in:
parent
433d3be8d5
commit
78a59ae8dc
@ -1,4 +1,4 @@
|
|||||||
name: Integration tests
|
name: Run tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@ -20,16 +20,27 @@ jobs:
|
|||||||
- name: yarn install
|
- name: yarn install
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
yarn install
|
||||||
- name: Run tests
|
- name: Integration tests
|
||||||
run: |
|
run: |
|
||||||
cd integration-tests
|
cd integration-tests
|
||||||
yarn test:ci
|
yarn test:ci
|
||||||
# yarn wait:ci
|
# yarn wait:ci
|
||||||
|
- name: Filter parser tests
|
||||||
|
run: |
|
||||||
|
cd packages/filterparser
|
||||||
|
yarn test:ci
|
||||||
- uses: tanmen/jest-reporter@v1
|
- uses: tanmen/jest-reporter@v1
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
result-file: integration-tests/result.json
|
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:
|
services:
|
||||||
postgres:
|
postgres:
|
@ -6,7 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"start": "tsc --watch",
|
"start": "tsc --watch",
|
||||||
"test": "jest"
|
"test": "jest",
|
||||||
|
"test:ci": "jest --json --outputFile=result.json --testLocationInResults"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
|
@ -3,5 +3,9 @@ import { parseFilter } from './parseFilter';
|
|||||||
test('parse string', () => {
|
test('parse string', () => {
|
||||||
const ast = parseFilter('"123"', 'string');
|
const ast = parseFilter('"123"', 'string');
|
||||||
console.log(JSON.stringify(ast));
|
console.log(JSON.stringify(ast));
|
||||||
expect(ast).toBe(3);
|
expect(ast).toEqual({
|
||||||
|
conditionType: 'like',
|
||||||
|
left: { exprType: 'placeholder' },
|
||||||
|
right: { exprType: 'value', value: '%123%' },
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user