duplicate-definitions
Tests duplicate definitions and links.
Our implementation passes this case when its check --json output for the input below equals the expected
output.
Input
nodes/a-link.md---
id: a-link
type: link-type
fields:
name: service
---nodes/a-type.md---
id: a-type
type: type
fields:
name: service
---nodes/b-type.md---
id: b-type
type: type
fields:
name: service
---nodes/c-type.md---
id: c-type
type: type
fields:
name: other
---nodes/d-type.md---
id: d-type
type: type
fields:
name: 3
---nodes/e-type.md---
id: e-type
type: type
fields:
name: 3
---Expected output
0 ghosts · 0 load errors · 6 nodes · 0 results
expected.json{
"ghosts": [],
"load_errors": [],
"nodes": [
{
"body": "",
"fields": {
"name": "service"
},
"id": "a-link",
"links": [],
"parent": null,
"plane": null,
"title": "a-link",
"type": "link-type"
},
{
"body": "",
"fields": {
"name": "service"
},
"id": "a-type",
"links": [],
"parent": null,
"plane": null,
"title": "a-type",
"type": "type"
},
{
"body": "",
"fields": {
"name": "service"
},
"id": "b-type",
"links": [],
"parent": null,
"plane": null,
"title": "b-type",
"type": "type"
},
{
"body": "",
"fields": {
"name": "other"
},
"id": "c-type",
"links": [],
"parent": null,
"plane": null,
"title": "c-type",
"type": "type"
},
{
"body": "",
"fields": {
"name": 3
},
"id": "d-type",
"links": [],
"parent": null,
"plane": null,
"title": "d-type",
"type": "type"
},
{
"body": "",
"fields": {
"name": 3
},
"id": "e-type",
"links": [],
"parent": null,
"plane": null,
"title": "e-type",
"type": "type"
}
],
"results": [],
"structure": {
"errors": [],
"warnings": [
{
"kind": "duplicate_definition",
"node": "a-type",
"ref": "service"
},
{
"kind": "duplicate_definition",
"node": "b-type",
"ref": "service"
}
]
}
}