Skip to content

Commit 31396be

Browse files
committed
feat: add notes on running validation and testing
1 parent d6e0cf5 commit 31396be

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,5 @@ jobs:
1414
id: configure
1515
- name: Install
1616
run: yarn
17-
- name: Check Formatting
18-
run: yarn format --check
19-
- name: Typecheck
20-
run: yarn typecheck
21-
- name: Tests
22-
run: yarn test
23-
- name: Validate schemas
24-
run: yarn test:schemas
25-
- name: Validate examples
26-
run: yarn test:examples
17+
- name: Check
18+
run: yarn ci

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ $ yarn start
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

19+
### Schema Validation
20+
21+
``` shell
22+
# Check that the schemas in `schemas/` are valid
23+
$ yarn test:schemas
24+
25+
# Check that the examples in `examples/` match the schemas in `schemas/`
26+
$ yarn test:examples
27+
```
28+
29+
### Testing
30+
31+
``` shell
32+
$ yarn ci
33+
# or
34+
$ yarn format --check
35+
$ yarn typecheck
36+
$ yarn test
37+
```
38+
1939
### Build
2040

2141
```

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"typecheck": "tsc",
1717
"test": "jest",
1818
"test:schemas": "ajv compile -s \"schemas/com.*.json\" --spec=draft2020 -c ajv-formats --strict=true -r \"schemas/cloudevents.json\" -r \"schemas/glides-events-schema.json\"",
19-
"test:examples": "ts-node src/scripts/validate_examples.ts"
19+
"test:examples": "ts-node src/scripts/validate_examples.ts",
20+
"ci": "yarn format --check && yarn typecheck && yarn test && yarn test:schemas && yarn test:examples"
2021
},
2122
"dependencies": {
2223
"@docusaurus/core": "2.4.0",

src/components/EventSchemaPath.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const viewerOptions = {
1313
export default function EventSchemaPath(props: { event: object }): JSX.Element {
1414
const [error, setError] = useState(undefined);
1515
const [resolvedSchema, setResolvedSchema] = useState(undefined);
16-
const schemaRoot = useBaseUrl("/schemas", {forcePrependBaseUrl: true});
16+
const schemaRoot = useBaseUrl("/schemas", { forcePrependBaseUrl: true });
1717
useEffect(() => {
1818
fetch(`${schemaRoot}/${props.event}.json`)
1919
.then((result) => result.json())

0 commit comments

Comments
 (0)