Skip to content

Commit

Permalink
v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Oct 21, 2020
1 parent bf295e5 commit 58e02dc
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 21 deletions.
2 changes: 1 addition & 1 deletion dist/joiprops.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/joiprops.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions joiprops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ function JoiProps(schema: object) {
'object' !== type
? term.schema._flags.default
: () => {
// NOTE: this will fail for schemas that do not provide full defaults,
// which is what you want - required values are, you know, required.
return Joi.attempt({}, term.schema)
},
// NOTE: this will fail for schemas that do not provide full defaults,
// which is what you want - required values are, you know, required.
return Joi.attempt({}, term.schema)
},
}
})

Expand All @@ -60,8 +60,8 @@ function JoiProps(schema: object) {
props,
joischema,
'JoiProps:' +
resolve_component_name(this.$options) +
' props validation failed:'
resolve_component_name(this.$options) +
' props validation failed:'
)
)
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "joiprops",
"version": "0.3.0",
"version": "0.4.0",
"description": "Use Joi Schemas for your Vue component prop validation (and deep structure defaults).",
"main": "dist/joiprops.js",
"browser": "dist/joiprops.min.js",
Expand Down
22 changes: 20 additions & 2 deletions test-web/test-web.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ <h1>Test Report</h1>
<div class="failures">0</div>
<div class="skipped">0</div>
<div class="test-count">4</div>
<div class="duration">33</div>
<div class="duration">58</div>
</div>
<div id="filters">
<input type="checkbox" checked="" onchange="filter(this)" value="success" id="show-success">
Expand All @@ -572,28 +572,28 @@ <h1>Test Report</h1>
<td class="test-title">joiprops happy

</td>
<td class="test-duration">13</td>
<td class="test-duration">27</td>
</tr>
<tr class="show joiprops success">
<td class="test-id">2</td>
<td class="test-title">joiprops accepts-joi-schema

</td>
<td class="test-duration">1</td>
<td class="test-duration">2</td>
</tr>
<tr class="show joiprops success">
<td class="test-id">3</td>
<td class="test-title">joiprops errors

</td>
<td class="test-duration">3</td>
<td class="test-duration">2</td>
</tr>
<tr class="show joiprops success">
<td class="test-id">4</td>
<td class="test-title">joiprops shortcuts

</td>
<td class="test-duration">6</td>
<td class="test-duration">10</td>
</tr>
</tbody>
</table>
Expand Down
24 changes: 19 additions & 5 deletions test/joiprops.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@ const describe = lab.describe
const it = lab.it
const expect = Code.expect

const { JoiProps, Joi, JO, JA, JS, JN, JB, JT, JF, JOu, Jr, JOd, JAd } = require('..')
const {
JoiProps,
Joi,
JO,
JA,
JS,
JN,
JB,
JT,
JF,
JOu,
Jr,
JOd,
JAd,
} = require('..')

describe('joiprops', function () {
it('happy', () => {
Expand Down Expand Up @@ -114,8 +128,8 @@ describe('joiprops', function () {
l: JS(Jr),
m: JN(Jr),
n: JA(Jr),
o: JOd({x:1}),
p: JAd([1,2]),
o: JOd({ x: 1 }),
p: JAd([1, 2]),
})

expect(
Expand Down Expand Up @@ -143,8 +157,8 @@ describe('joiprops', function () {
l: 'L',
m: 10,
n: [],
o: {x:1},
p: [1,2]
o: { x: 1 },
p: [1, 2],
})

try {
Expand Down

0 comments on commit 58e02dc

Please sign in to comment.