Skip to content

Commit 0bbbcfc

Browse files
committed
fix plugin tests
Signed-off-by: Alexandre Ferreira <alexjorgef@protonmail.com>
1 parent 626950e commit 0bbbcfc

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

plugin/src/__tests__/plugin-options-schema.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe(`pluginOptionsSchema`, () => {
1313
const { isValid, errors } = await testPluginOptionsSchema(pluginOptionsSchema, options)
1414

1515
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`])
1717
})
1818
it(`should invalidate incorrect options (deep)`, async () => {
1919
const options = {
@@ -36,31 +36,12 @@ describe(`pluginOptionsSchema`, () => {
3636
const { isValid, errors } = await testPluginOptionsSchema(pluginOptionsSchema, options)
3737

3838
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`])
4740
})
4841
it(`should validate correct options`, async () => {
4942
const options = {
5043
api_token: `test`,
5144
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-
],
6445
}
6546

6647
const { isValid, errors } = await testPluginOptionsSchema(pluginOptionsSchema, options)

0 commit comments

Comments
 (0)