UNPKG

@hello.nrfcloud.com/proto

Version:

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

25 lines (24 loc) 904 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' assert { type: 'json' }; import INTERNAL_ERROR from './examples/INTERNAL_ERROR.json' assert { type: 'json' }; void describe('Error example messages', function() { var _loop = function(_i, _iter) { var example = _iter[_i]; void it("should validate error ".concat(JSON.stringify(example)), function() { var result = validator(example); assert.equal('errors' in result, false); }); }; var validator = validateWithTypeBox(ProblemDetail); for(var _i = 0, _iter = [ BAD_REQUEST, INTERNAL_ERROR ]; _i < _iter.length; _i++)_loop(_i, _iter); });