Fix issues with enum options filtering logic in enum_ function #1795
Annotations
5 errors and 1 warning
Vitest tests:
library/src/schemas/enum/enum.test.ts#L87
AssertionError: expected { kind: 'schema', type: 'enum', …(8) } to strictly equal { kind: 'schema', type: 'enum', …(8) }
- Expected
+ Received
Object {
"async": false,
"enum": Object {
"1": "foo",
"1.7976931348623157e+308": "bar",
"1.7976931348623157e308": "baz",
"5e-324": "qux",
"Infinity": "Infinity",
"NaN": "NaN",
},
- "expects": "\"baz\"",
+ "expects": "(\"foo\" | \"bar\" | \"baz\" | \"qux\" | \"NaN\" | \"Infinity\")",
"kind": "schema",
"message": undefined,
"options": Array [
+ "foo",
+ "bar",
"baz",
+ "qux",
+ "NaN",
+ "Infinity",
],
"reference": [Function enum_],
"type": "enum",
"~run": Any<Function>,
"~standard": Object {
"validate": Any<Function>,
"vendor": "valibot",
"version": 1,
},
}
❯ src/schemas/enum/enum.test.ts:87:37
|
Vitest tests:
library/src/schemas/enum/enum.test.ts#L92
AssertionError: expected { kind: 'schema', type: 'enum', …(8) } to strictly equal { kind: 'schema', type: 'enum', …(8) }
- Expected
+ Received
Object {
"async": false,
"enum": Object {
"1": "foo",
"1.7976931348623157e+308": "bar",
"1.7976931348623157e308": "baz",
"5e-324": "qux",
"Infinity": "Infinity",
"NaN": "NaN",
},
- "expects": "\"baz\"",
+ "expects": "(\"foo\" | \"bar\" | \"baz\" | \"qux\" | \"NaN\" | \"Infinity\")",
"kind": "schema",
"message": "message",
"options": Array [
+ "foo",
+ "bar",
"baz",
+ "qux",
+ "NaN",
+ "Infinity",
],
"reference": [Function enum_],
"type": "enum",
"~run": Any<Function>,
"~standard": Object {
"validate": Any<Function>,
"vendor": "valibot",
"version": 1,
},
}
❯ src/schemas/enum/enum.test.ts:92:48
|
Vitest tests:
library/src/schemas/enum/enum.test.ts#L100
AssertionError: expected { kind: 'schema', type: 'enum', …(8) } to strictly equal { kind: 'schema', type: 'enum', …(8) }
- Expected
+ Received
Object {
"async": false,
"enum": Object {
"1": "foo",
"1.7976931348623157e+308": "bar",
"1.7976931348623157e308": "baz",
"5e-324": "qux",
"Infinity": "Infinity",
"NaN": "NaN",
},
- "expects": "\"baz\"",
+ "expects": "(\"foo\" | \"bar\" | \"baz\" | \"qux\" | \"NaN\" | \"Infinity\")",
"kind": "schema",
"message": [Function message],
"options": Array [
+ "foo",
+ "bar",
"baz",
+ "qux",
+ "NaN",
+ "Infinity",
],
"reference": [Function enum_],
"type": "enum",
"~run": Any<Function>,
"~standard": Object {
"validate": Any<Function>,
"vendor": "valibot",
"version": 1,
},
}
❯ src/schemas/enum/enum.test.ts:100:46
|
Vitest tests:
library/src/vitest/expectSchemaIssue.ts#L27
AssertionError: expected { value: 'foo', typed: true } to strictly equal { typed: false, value: 'foo', …(1) }
- Expected
+ Received
Object {
- "issues": Array [
- Object {
- "abortEarly": undefined,
- "abortPipeEarly": undefined,
- "expected": "\"baz\"",
- "input": "foo",
- "issues": undefined,
- "kind": "schema",
- "lang": undefined,
- "message": "message",
- "path": undefined,
- "received": "\"foo\"",
- "requirement": undefined,
- "type": "enum",
- },
- ],
- "typed": false,
+ "typed": true,
"value": "foo",
}
❯ Module.expectSchemaIssue src/vitest/expectSchemaIssue.ts:27:43
❯ src/schemas/enum/enum.test.ts:213:7
|
Vitest tests
Process completed with exit code 1.
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading