(idFragment)
| 23 | |
| 24 | describe('JSON-LD', function () { |
| 25 | function isCorrectSubject (idFragment) { |
| 26 | return (res) => { |
| 27 | const payload = JSON.parse(res.text) |
| 28 | const id = payload['@id'] |
| 29 | assert(id.endsWith(idFragment), 'The subject of the JSON-LD graph is correct') |
| 30 | } |
| 31 | } |
| 32 | function isValidJSON (res) { |
| 33 | // This would throw an error |
| 34 | JSON.parse(res.text) |