Skip to content

Commit 6554f93

Browse files
committed
cleanup
1 parent 37cd9e9 commit 6554f93

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/lib/index.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ jsf.resolveWithContext = (schema, refs, cwd) => {
113113
refs = {};
114114
}
115115

116+
// investigate this!!
117+
if (!schema) {
118+
return Promise.resolve({});
119+
}
120+
116121
// normalize basedir (browser aware)
117122
cwd = cwd || (typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '');
118123
cwd = `${cwd.replace(/\/+$/, '')}/`;

tests/unit/core/traverse.spec.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ describe('Traverse', () => {
5353
};
5454

5555
expect(traverse(schema, [], mockResolve, schema)).to.eql({
56-
value: [],
56+
value: ['foo'],
5757
context: {
5858
schemaPath: [],
5959
title: schema.title,
60-
items: []
60+
items: [
61+
{
62+
schemaPath: ['items'],
63+
description: schema.items.description,
64+
},
65+
],
6166
},
6267
});
6368
});

0 commit comments

Comments
 (0)