api-tuner 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,13 +6,15 @@
6
6
 
7
7
  - [SWI Prolog](https://www.swi-prolog.org/Download.html)
8
8
 
9
- Follow platform-specific instructions to install locally oor in a docker image.
9
+ Follow platform-specific instructions to install locally oor in a docker image.
10
10
 
11
- To run `api-tuner` in GitHub workflow, you add this action to your jobs:
11
+ To run `api-tuner` in GitHub workflow, you add this action to your jobs:
12
12
 
13
- ```yaml
14
- - uses: fabasoad/setup-prolog-action@v1
15
- ```
13
+ ```yaml
14
+ - uses: fabasoad/setup-prolog-action@v1
15
+ ```
16
+
17
+ - curl 7.83+
16
18
 
17
19
  ## Installation
18
20
 
@@ -25,6 +27,7 @@ To run `api-tuner` in GitHub workflow, you add this action to your jobs:
25
27
  Usage: api-tuner [options] <path>...
26
28
 
27
29
  Options:
30
+ --lib <path> Specify rules to include in all tests
28
31
  --silent Less output
29
32
  --debug Enable debug output
30
33
  --raw Output raw results from eye
package/bin/tuner.sh CHANGED
@@ -15,6 +15,7 @@ function version() {
15
15
  echo "Usage: api-tuner [options] <path>..."
16
16
  echo ""
17
17
  echo "Options:"
18
+ echo " --lib <path> Specify rules to include in all tests"
18
19
  echo " --silent Less output"
19
20
  echo " --debug Enable debug output"
20
21
  echo " --raw Output raw results from eye"
@@ -28,6 +29,7 @@ BASE_IRI=""
28
29
  DEBUG=false
29
30
  SUMMARY="node ${SCRIPT_PATH}/../lib/summarise-results.js --summary"
30
31
  PATHS=()
32
+ LIBS=()
31
33
  # USAGE: ./tuner.sh --debug --version ...paths
32
34
  while [ $# -gt 0 ]; do
33
35
  case "$1" in
@@ -56,6 +58,11 @@ while [ $# -gt 0 ]; do
56
58
  usage
57
59
  exit 0
58
60
  ;;
61
+ --lib)
62
+ LIBS+=("$2")
63
+ shift
64
+ shift
65
+ ;;
59
66
  *)
60
67
  PATHS+=("$1")
61
68
  shift
@@ -83,6 +90,6 @@ set -o pipefail
83
90
  for path in "${PATHS[@]}"; do
84
91
  (
85
92
  node "${SCRIPT_PATH}/../lib/parse-test-case.js" --base-iri "$BASE_IRI" -- "${path}" \
86
- | $eye $ARGS "${SCRIPT_PATH}"/../rules/*.n3 -
93
+ | $eye $ARGS "${SCRIPT_PATH}"/../rules/*.n3 ${LIBS[@]:+"${LIBS[*]}"} -
87
94
  ) ;
88
95
  done | $SUMMARY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-tuner",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "postinstall": "([ -d eye ] || npm run download-eye) && eye/install.sh --prefix=eye",
13
13
  "prepare": "husky",
14
14
  "lint": "eslint . --quiet --ignore-path .gitignore",
15
+ "pretest": "docker compose up -d",
15
16
  "test": "./bin/tuner.sh tests/*.n3 tests/**/*.n3 --base-iri http://localhost:1080/",
16
17
  "release": "changeset publish"
17
18
  },
@@ -1,3 +1,4 @@
1
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
1
2
  PREFIX tuner: <https://api-tuner.described.at/>
2
3
  prefix string: <http://www.w3.org/2000/10/swap/string#>
3
4
  prefix log: <http://www.w3.org/2000/10/swap/log#>
@@ -10,9 +11,9 @@ prefix log: <http://www.w3.org/2000/10/swap/log#>
10
11
  true
11
12
  {
12
13
  (
13
- { ?msg log:rawType log:ForAll }
14
- { ?expr^tuner:logFailedAssertion }
14
+ { ?msg!log:rawType list:in ( log:Literal rdf:List ) }
15
15
  { ?msg^tuner:logFailedAssertion }
16
+ { ?expr^tuner:logFailedAssertion }
16
17
  ) log:ifThenElseIn [].
17
18
  true log:equalTo false .
18
19
  }