Skip to content

Commit b6a9caa

Browse files
committed
feat(helper): fix tests
1 parent 6a7beb8 commit b6a9caa

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

packages/field-plugin/helpers/vite/src/manifest.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ const validateSchema = (manifest: Manifest): void => {
4646
})
4747

4848
//NOTE: accepted empty options case
49-
if (
50-
manifest.options === undefined ||
51-
Object.keys(manifest.options).length === 0
52-
) {
49+
if (manifest.options === undefined) {
5350
return
5451
}
5552

packages/manifest-helper/src/__tests__/manifest.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('manifest', () => {
4646
)
4747

4848
expect(() => load()).toThrowErrorMatchingInlineSnapshot(
49-
`[Error: Error while loading the manifest file: The 'options' property should be an array]`,
49+
`[Error: Error while loading the manifest file: When declared, the 'options' property should be an array]`,
5050
)
5151
})
5252

@@ -65,7 +65,7 @@ describe('manifest', () => {
6565
)
6666

6767
expect(() => load()).toThrowErrorMatchingInlineSnapshot(
68-
`[Error: Error while loading the manifest file: Some of the defined 'options' are invalid. Please, make sure they contain a 'name' and 'value' properties]`,
68+
`[Error: Error while loading the manifest file: Each option must be an object with string properties "name" and "value". The following values need to be corrected: \n {"value":""} --> Incorrect object value. Must be of type {"name": string, "value": string}.]`,
6969
)
7070
})
7171

@@ -84,7 +84,7 @@ describe('manifest', () => {
8484
)
8585

8686
expect(() => load()).toThrowErrorMatchingInlineSnapshot(
87-
`[Error: Error while loading the manifest file: Some of the defined 'options' are invalid. Please, make sure they contain a 'name' and 'value' properties]`,
87+
`[Error: Error while loading the manifest file: Each option must be an object with string properties "name" and "value". The following values need to be corrected: \n {"name":""} --> Incorrect object value. Must be of type {"name": string, "value": string}.]`,
8888
)
8989
})
9090

packages/manifest-helper/src/manifest.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ const validateSchema = (manifest: Manifest): void => {
4949
})
5050

5151
//NOTE: accepted empty options case
52-
if (
53-
manifest.options === undefined ||
54-
Object.keys(manifest.options).length === 0
55-
) {
52+
if (manifest.options === undefined) {
5653
return
5754
}
5855

0 commit comments

Comments
 (0)