Skip to content

Commit 868db0d

Browse files
committed
test for $quote
1 parent 33f48df commit 868db0d

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# jsonscript-test-suite
22
Tests for JSONScript interpreters
33

4-
Work in progress
54

65
[![Build Status](https://travis-ci.org/JSONScript/jsonscript-test-suite.svg?branch=master)](https://travis-ci.org/JSONScript/jsonscript-test-suite)
6+
[![npm version](https://badge.fury.io/js/jsonscript-test-suite.svg)](https://www.npmjs.com/package/jsonscript-test-suite)
7+
8+
9+
The repository contains a set of language agnostic test descriptions (JSON objects) that can be used to test JSONScript interpreters.
10+
11+
For JavaScript interpreters of JSONScript the package [jsonscript-test](https://github.com/JSONScript/jsonscript-test) can be used, otherwise they should be converted to tests in the chosen test framework.
12+
13+
The test files should be valid according to [the schema](https://github.com/JSONScript/jsonscript-test-suite/blob/master/test_suite_schema.json).

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonscript-test-suite",
3-
"version": "0.2.3",
3+
"version": "0.3.0",
44
"description": "Tests for JSONScript interpreters",
55
"main": "lib/index.js",
66
"scripts": {

tests/$quote.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[
2+
{
3+
"description": "$quote - use value without evaluation",
4+
"tests": [
5+
{
6+
"description": "without $quote the script is evaluated",
7+
"script": {
8+
"$exec": "router1",
9+
"$method": "get",
10+
"$args": { "path": "/resource/1" }
11+
},
12+
"result": "you requested /resource/1 from router1"
13+
},
14+
{
15+
"description": "with $quote the script returned as is",
16+
"script": {
17+
"$quote": {
18+
"$exec": "router1",
19+
"$method": "get",
20+
"$args": { "path": "/resource/1" }
21+
}
22+
},
23+
"result": {
24+
"$exec": "router1",
25+
"$method": "get",
26+
"$args": { "path": "/resource/1" }
27+
}
28+
}
29+
]
30+
}
31+
]

0 commit comments

Comments
 (0)