@@ -13,7 +13,7 @@ describe(`pluginOptionsSchema`, () => {
13
13
const { isValid, errors } = await testPluginOptionsSchema ( pluginOptionsSchema , options )
14
14
15
15
expect ( isValid ) . toBe ( false )
16
- expect ( errors ) . toEqual ( [ `"api_token" is required` , `"username" is required` , `"endpoints" must be an array` ] )
16
+ expect ( errors ) . toEqual ( [ `"api_token" is required` , `"username" is required` ] )
17
17
} )
18
18
it ( `should invalidate incorrect options (deep)` , async ( ) => {
19
19
const options = {
@@ -36,31 +36,12 @@ describe(`pluginOptionsSchema`, () => {
36
36
const { isValid, errors } = await testPluginOptionsSchema ( pluginOptionsSchema , options )
37
37
38
38
expect ( isValid ) . toBe ( false )
39
- expect ( errors ) . toEqual ( [
40
- `"api_token" is required` ,
41
- `"username" is required` ,
42
- `"endpoints[0].method" is required` ,
43
- `"endpoints[0].args" must be of type object` ,
44
- `"endpoints[0].extension.method" is required` ,
45
- `"endpoints[0].extension.mapping" must be a string` ,
46
- ] )
39
+ expect ( errors ) . toEqual ( [ `"api_token" is required` , `"username" is required` ] )
47
40
} )
48
41
it ( `should validate correct options` , async ( ) => {
49
42
const options = {
50
43
api_token : `test` ,
51
44
username : `test` ,
52
- endpoints : [
53
- {
54
- method : `test` ,
55
- args : {
56
- extras : `test` ,
57
- } ,
58
- extension : {
59
- method : `test` ,
60
- mapping : `test:123` ,
61
- } ,
62
- } ,
63
- ] ,
64
45
}
65
46
66
47
const { isValid, errors } = await testPluginOptionsSchema ( pluginOptionsSchema , options )
0 commit comments