deno/tests/specs/schema.json
David Sherret 3e98ea4e69
chore(tests/specs): ability to have sub tests in file (#23667)
Allows writing named sub-tests. These are:

1. Filterable on the command line via `cargo test ...`
2. Run in parallel
3. Use a fresh temp and deno dir for each test (unlike steps)
2024-05-03 10:19:42 +05:30

130 lines
2.8 KiB
JSON

{
"$id": "https://github.com/denoland/deno/blob/tests/specs/schema.json",
"$schema": "http://json-schema.org/draft-07/schema",
"description": "Schema file for the __test__.jsonc files",
"required": [],
"title": "Deno internal spec test schema",
"type": "object",
"definitions": {
"single_test": {
"type": "object",
"required": ["args", "output"],
"properties": {
"args": {
"default": "",
"oneOf": [{
"type": "string"
}, {
"type": "array",
"items": {
"type": "string"
}
}]
},
"cwd": {
"type": "string"
},
"commandName": {
"type": "string"
},
"envs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"flaky": {
"type": "boolean"
},
"if": {
"type": "string",
"examples": [
"mac",
"linux",
"windows",
"unix"
]
},
"output": {
"type": "string"
},
"exitCode": {
"type": "integer"
}
}
},
"single_or_multi_step_test": {
"oneOf": [{
"required": ["steps"],
"properties": {
"tempDir": {
"type": "boolean"
},
"base": {
"type": "string"
},
"envs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/single_test"
}
}
}
}, {
"allOf": [{
"properties": {
"tempDir": {
"type": "boolean"
},
"base": {
"type": "string"
},
"envs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}, {
"$ref": "#/definitions/single_test"
}]
}]
},
"multi_test": {
"required": ["tests"],
"properties": {
"tempDir": {
"type": "boolean"
},
"base": {
"type": "string"
},
"envs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"tests": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/single_or_multi_step_test"
}
}
}
}
},
"oneOf": [{
"$ref": "#/definitions/single_or_multi_step_test"
}, {
"$ref": "#/definitions/multi_test"
}]
}