Skip to content

Commit ffa50d5

Browse files
authored
Move Vitest expression tests to JSON (#1173)
* move distance expression tests to JSON * move array expression tests to JSON * move format expression tests to JSON * move image expression tests to JSON * move typeof expression tests to JSON * move feature-state expression tests to JSON * move get expression tests to JSON * move global-state expression tests to JSON * move has expression tests to JSON * move at expression tests to JSON * move in expression tests to JSON * move index-of expression tests to JSON * move length expression tests to JSON * move slice expression tests to JSON * move comparison expression tests to JSON * move any expression tests to JSON * move case expression tests to JSON * move match expression tests to JSON * move within expression tests to JSON * move interpolation expression tests to JSON * move step expression tests to JSON * move e expression tests to JSON * clean up unused imports * restore test coverage * separate type tests into `expression.test-d.ts`
1 parent 2af178e commit ffa50d5

File tree

170 files changed

+12056
-1938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+12056
-1938
lines changed

src/expression/expression.test-d.ts

Lines changed: 546 additions & 0 deletions
Large diffs are not rendered by default.

src/expression/expression.test.ts

Lines changed: 18 additions & 1936 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"expression": [
3+
"array",
4+
[
5+
"literal",
6+
[]
7+
]
8+
],
9+
"inputs": [
10+
[
11+
{},
12+
{}
13+
]
14+
],
15+
"expected": {
16+
"compiled": {
17+
"result": "success",
18+
"isFeatureConstant": true,
19+
"isZoomConstant": true,
20+
"type": "array"
21+
},
22+
"outputs": [
23+
[]
24+
]
25+
}
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"expression": [
3+
"array",
4+
1,
5+
2,
6+
3
7+
],
8+
"inputs": [
9+
[
10+
{},
11+
{}
12+
]
13+
],
14+
"expected": {
15+
"compiled": {
16+
"result": "error",
17+
"errors": [
18+
{
19+
"key": "[1]",
20+
"error": "The item type argument of \"array\" must be one of string, number, boolean"
21+
}
22+
]
23+
}
24+
}
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"expression": [
3+
"array",
4+
"number",
5+
3,
6+
[
7+
1,
8+
2,
9+
3
10+
]
11+
],
12+
"inputs": [
13+
[
14+
{},
15+
{}
16+
]
17+
],
18+
"expected": {
19+
"compiled": {
20+
"result": "error",
21+
"errors": [
22+
{
23+
"key": "[3][0]",
24+
"error": "Expression name must be a string, but found number instead. If you wanted a literal array, use [\"literal\", [...]]."
25+
}
26+
]
27+
}
28+
}
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"expression": [
3+
"array",
4+
"number",
5+
[
6+
1,
7+
2,
8+
3
9+
]
10+
],
11+
"inputs": [
12+
[
13+
{},
14+
{}
15+
]
16+
],
17+
"expected": {
18+
"compiled": {
19+
"result": "error",
20+
"errors": [
21+
{
22+
"key": "[2][0]",
23+
"error": "Expression name must be a string, but found number instead. If you wanted a literal array, use [\"literal\", [...]]."
24+
}
25+
]
26+
}
27+
}
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"expression": [
3+
"array",
4+
[
5+
1,
6+
2,
7+
3
8+
]
9+
],
10+
"inputs": [
11+
[
12+
{},
13+
{}
14+
]
15+
],
16+
"expected": {
17+
"compiled": {
18+
"result": "error",
19+
"errors": [
20+
{
21+
"key": "[1][0]",
22+
"error": "Expression name must be a string, but found number instead. If you wanted a literal array, use [\"literal\", [...]]."
23+
}
24+
]
25+
}
26+
}
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expression": [
3+
"array",
4+
[
5+
"literal",
6+
"number"
7+
],
8+
[
9+
"literal",
10+
[]
11+
]
12+
],
13+
"inputs": [
14+
[
15+
{},
16+
{}
17+
]
18+
],
19+
"expected": {
20+
"compiled": {
21+
"result": "error",
22+
"errors": [
23+
{
24+
"key": "[1]",
25+
"error": "The item type argument of \"array\" must be one of string, number, boolean"
26+
}
27+
]
28+
}
29+
}
30+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"expression": [
3+
"array",
4+
"0",
5+
[
6+
"literal",
7+
[]
8+
]
9+
],
10+
"inputs": [
11+
[
12+
{},
13+
{}
14+
]
15+
],
16+
"expected": {
17+
"compiled": {
18+
"result": "error",
19+
"errors": [
20+
{
21+
"key": "[1]",
22+
"error": "The item type argument of \"array\" must be one of string, number, boolean"
23+
}
24+
]
25+
}
26+
}
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"expression": [
3+
"array",
4+
0,
5+
[
6+
"literal",
7+
[]
8+
]
9+
],
10+
"inputs": [
11+
[
12+
{},
13+
{}
14+
]
15+
],
16+
"expected": {
17+
"compiled": {
18+
"result": "error",
19+
"errors": [
20+
{
21+
"key": "[1]",
22+
"error": "The item type argument of \"array\" must be one of string, number, boolean"
23+
}
24+
]
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)