diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index 93de58b64c..b6f23223d5 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -33,7 +33,8 @@ jobs: - name: Install dependencies run: yarn install --immutable - - name: Run tests - run: yarn test + - name: Run schema tests + if: ${{ hashFiles('tests/schema/schema.test.mjs') != '' }} + run: yarn test tests/schema/schema.test.mjs env: BASE: ${{ github.event.pull_request.base.ref }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2f87a526e..40df0577a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -209,7 +209,7 @@ Before creating a pull request or marking a draft pull request as ready for revi | `yarn validate-markdown` | markdownlint + link check only — fast loop while editing | | `yarn format-markdown` | auto-fix markdownlint violations | | `yarn build-src` | full check: validation, HTML build, schema publish | - | `yarn test` | runs the JSON Schema and build tooling test suites | + | `yarn test` | runs the JSON Schema test suite on development branches | 5. After `yarn build-src`, open output file `deploy-preview/oas.html` with a browser and check your changes diff --git a/tests/md2html/README.md b/tests/md2html/README.md deleted file mode 100644 index 726a104d58..0000000000 --- a/tests/md2html/README.md +++ /dev/null @@ -1,7 +0,0 @@ -To view the HTML files in folder `fixtures` with respec formatting, you can -~~~sh -mkdir js -cp ../../node_modules/respec/builds/respec-w3c.js js/ -echo "*" > js/.gitignore -~~~ -and open them in a local browser. diff --git a/tests/md2html/fixtures/.gitattributes b/tests/md2html/fixtures/.gitattributes deleted file mode 100644 index 9a582600c1..0000000000 --- a/tests/md2html/fixtures/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.html text eol=lf \ No newline at end of file diff --git a/tests/md2html/fixtures/basic-new.html b/tests/md2html/fixtures/basic-new.html deleted file mode 100644 index 7f04b29f3d..0000000000 --- a/tests/md2html/fixtures/basic-new.html +++ /dev/null @@ -1,119 +0,0 @@ -
- - - - -Copyright © 3001 the Linux Foundation
Text for first chapter
-This is the conformance section
-Text for first section
-Definition of Foo.
-Text for second section
- -Relative link to something else
-Text for first subsection
-[[RFC3986]]
-[[RFC9110]] Section 4
-{
- "foo": true
-}
-
-foo: true
-
-text/plain
-
-no language
-
-unknown language
-
-https://foo.com/bar?baz=qux&fred=waldo#fragment
-
-https://foo.com/bar{?baz*,qux}
-
---boundary-example
-Content-Type: application/openapi+yaml
-Content-Location: https://inaccessible-domain.com/api/openapi.yaml
-
-openapi: 3.2.0
-info:
- title: Example API
- version: 1.0
- externalDocs:
- url: docs.html
-
---boundary-example
-Content-Type: text/html
-Content-Location: https://example.com/api/docs.html
-
-<html>
- <head>
- <title>API Documentation</title>
- </head>
- <body>
- <p>Awesome documentation goes here</p>
- </body>
-</html>
-
-event: addString
-data: This data is formatted
-data: across two lines
-retry: 5
-
-event: addNumber
-data: 1234.5678
-unknownField: this is ignored
-
-: This is a comment
-event: addJSON
-data: {"foo": 42}
-
-{"event": "addString", "data": "This data is formatted\nacross two lines", "retry": 5}
-{"event": "addNumber", "data": "1234.5678"}
-{"event": "addJSON", "data": "{\"foo\": 42}"}
-
-{"event": "addString", "data": "This data is formatted\nacross two lines", "retry": 5}
-{"event": "addNumber", "data": "1234.5678"}
-{"event": "addJSON", "data": "{\"foo\": 42}"}
-
-0x1E{
- "timestamp": "1985-04-12T23:20:50.52Z",
- "level": 1,
- "message": "Hi!"
-}
-0x1E{
- "timestamp": "1985-04-12T23:20:51.37Z",
- "level": 1,
- "message": "Bye!"
-}
-
-| Version | -Date | -
|---|---|
| 30.0.1 | -3001-04-01 | -
Awesome documentation goes here
- - -``` - -```eventstream -event: addString -data: This data is formatted -data: across two lines -retry: 5 - -event: addNumber -data: 1234.5678 -unknownField: this is ignored - -: This is a comment -event: addJSON -data: {"foo": 42} -``` - -```jsonl -{"event": "addString", "data": "This data is formatted\nacross two lines", "retry": 5} -{"event": "addNumber", "data": "1234.5678"} -{"event": "addJSON", "data": "{\"foo\": 42}"} -``` - -```ndjson -{"event": "addString", "data": "This data is formatted\nacross two lines", "retry": 5} -{"event": "addNumber", "data": "1234.5678"} -{"event": "addJSON", "data": "{\"foo\": 42}"} -``` - -```jsonseq -0x1E{ - "timestamp": "1985-04-12T23:20:50.52Z", - "level": 1, - "message": "Hi!" -} -0x1E{ - "timestamp": "1985-04-12T23:20:51.37Z", - "level": 1, - "message": "Bye!" -} -``` - -## Appendix A: Revision History - -Version | Date ---------|----------- -30.0.1 | 3001-04-01 diff --git a/tests/md2html/fixtures/basic-old.html b/tests/md2html/fixtures/basic-old.html deleted file mode 100644 index c0beda2755..0000000000 --- a/tests/md2html/fixtures/basic-old.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -Copyright © 3001 the Linux Foundation
Text for first chapter
-This is the conformance section
-Text for first section
-Broken anchor
-Text for first subsection
-| Version | -Date | -
|---|---|
| 30.0.1 | -3001-04-01 | -