Skip to content

Commit f1e53e5

Browse files
authored
Task: add tests (#64)
* initialise test runs * add node_modules to gitignore * add sample test for more than one sample * test that sample body is a valid json string * combine queries into one loop * add check for id exists * add github actions * rename job title * add shema to validate json schema * add checkout to step * remove extra properties from schema * remove tests covered by schema check * id value should be uuid * doclink should be a uri * id should be unique * fix length check for sample id * add enum to method validator * method validation should fail * add additional properties to check enum * add methods to method-enum
1 parent 36a8cea commit f1e53e5

7 files changed

Lines changed: 5230 additions & 0 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Validate sample queries
2+
on: [pull_request,push]
3+
4+
jobs:
5+
validate-json-schema:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1
9+
- name: Validate json schema
10+
uses: docker://orrosenblatt/validate-json-action:latest
11+
env:
12+
INPUT_SCHEMA: /tests/samples.schema.json
13+
INPUT_JSONS: /sample-queries/sample-queries.json
14+
15+
test:
16+
runs-on: ubuntu-latest
17+
needs: validate-json-schema
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Install
22+
run: npm install
23+
24+
- name: Run test
25+
run: npm run test

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)