1 | 'use strict'
|
2 |
|
3 | const test = require('tap').test
|
4 | const { Schemas } = require('../../lib/schemas')
|
5 |
|
6 | test('Should not change resolved schema', t => {
|
7 | t.plan(4)
|
8 |
|
9 | const schemas = new Schemas()
|
10 | schemas.add({
|
11 | $id: 'A',
|
12 | field: 'value'
|
13 | })
|
14 | const schema = {
|
15 | a: 'A#'
|
16 | }
|
17 | const resolvedSchema = schemas.resolveRefs(schema)
|
18 |
|
19 | t.same(resolvedSchema.a, {
|
20 | field: 'value'
|
21 | })
|
22 | t.same(resolvedSchema.$id, undefined)
|
23 |
|
24 | schemas.getJsonSchemas()
|
25 |
|
26 | t.same(resolvedSchema.a, {
|
27 | field: 'value'
|
28 | })
|
29 | t.same(resolvedSchema.$id, undefined)
|
30 | })
|