Skip to content

Commit 6ff819b

Browse files
committed
Simplify test for read only arrays
1 parent b73718b commit 6ff819b

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

test/programs/array-readonly/main.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export interface ArrayThatIsReadonly {
2-
test: ReadonlyArray<any>;
3-
}
1+
export type MyReadOnlyArray = ReadonlyArray<number>;
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"type": "object",
4-
"properties": {
5-
"test": {
6-
"type": "array",
7-
"items": {}
8-
}
9-
},
10-
"required": [
11-
"test"
12-
]
3+
"type": "array",
4+
"items": {
5+
"type": "number"
6+
}
137
}

test/schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe("schema", () => {
6868
assertSchema("string-literals", "main.ts", "MyObject");
6969
assertSchema("string-literals-inline", "main.ts", "MyObject");
7070

71-
assertSchema("array-readonly", "main.ts", "ArrayThatIsReadonly");
71+
assertSchema("array-readonly", "main.ts", "MyReadOnlyArray");
7272
assertSchema("array-types", "main.ts", "MyArray");
7373
assertSchema("map-types", "main.ts", "MyObject");
7474

0 commit comments

Comments
 (0)