UNPKG

@hello.nrfcloud.com/proto

Version:

Documents the communication protocol between the hello.nrfcloud.com backend and the web application

18 lines (15 loc) 696 B
import assert from 'node:assert/strict' import { describe, test as it } from 'node:test' import { validateWithTypeBox } from '../../validator/validateWithTypeBox.js' import { ProblemDetail } from './ProblemDetail.js' import BAD_REQUEST from './examples/BAD_REQUEST.json' with { type: 'json' } import INTERNAL_ERROR from './examples/INTERNAL_ERROR.json' with { type: 'json' } void describe('Error example messages', () => { const validator = validateWithTypeBox(ProblemDetail) for (const example of [BAD_REQUEST, INTERNAL_ERROR]) { void it(`should validate error ${JSON.stringify(example)}`, () => { const result = validator(example) assert.equal('errors' in result, false) }) } })