Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test to verify ND-JSON content is not serialized as JSON #2349

Merged
merged 1 commit into from
Jun 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/internals/reply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ test('plain string with content type application/json should NOT be serialized a
})

test('plain string with custom json content type should NOT be serialized as json', t => {
t.plan(16)
t.plan(19)

const fastify = require('../..')()

Expand All @@ -566,6 +566,10 @@ test('plain string with custom json content type should NOT be serialized as jso
mimeType: 'application/ld+json',
sample: '{"@context":"https://json-ld.org/contexts/person.jsonld","name":"John Doe"}'
},
ndjson: {
mimeType: 'application/x-ndjson',
sample: '{"a":"apple","b":{"bb":"bubble"}}\n{"c":"croissant","bd":{"dd":"dribble"}}'
},
siren: {
mimeType: 'application/vnd.siren+json',
sample: '{"class":"person","properties":{"name":"John Doe"}}'
Expand Down