From a342ba132bfd679b48df47685ef65c5ad0683ae9 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Sat, 18 Jan 2025 17:26:27 +0000 Subject: [PATCH] chore: update test --- .../unplugin-typia/tests/fixtures/__snapshots__/alias.ts | 8 +++++--- .../tests/fixtures/__snapshots__/esbuild/alias.js | 8 +++++--- .../tests/fixtures/__snapshots__/esbuild/validate.js | 8 +++++--- .../tests/fixtures/__snapshots__/rollup/alias.js | 8 +++++--- .../tests/fixtures/__snapshots__/rollup/validate.js | 8 +++++--- .../tests/fixtures/__snapshots__/validate.ts | 8 +++++--- .../tests/fixtures/__snapshots__/vite/alias.js | 8 +++++--- .../tests/fixtures/__snapshots__/vite/validate.js | 8 +++++--- 8 files changed, 40 insertions(+), 24 deletions(-) diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts index 8a542169..2b9a856f 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts @@ -67,15 +67,17 @@ const validate = (() => { const _io0 = (input: any): boolean => "string" === typ value: input }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : undefined + data: input } as any; } return { success: true, - errors: [], data: input } as any; }; })(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js index 26b9673a..f42558b7 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/alias.js @@ -19,15 +19,17 @@ const validate = /* @__PURE__ */ (() => { _report = __typia_transform__validateReport._validateReport(errors); /* @__PURE__ */ ((input2, _path, _exceptionable = true) => true)(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; }; diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js index 2d0b97fe..0f38cdab 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/esbuild/validate.js @@ -54,15 +54,17 @@ const validate = /* @__PURE__ */ (() => { value: input2 }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; }; diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js index 9fded5a7..f4ca7841 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/alias.js @@ -16,15 +16,17 @@ const validate = /* @__PURE__ */ (() => { errors = []; __typia_transform__validateReport._validateReport(errors); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; }; diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js index 3fea3afb..4366c74f 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/rollup/validate.js @@ -56,15 +56,17 @@ const validate = /* @__PURE__ */ (() => { value: input2 }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; }; diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts b/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts index c675e946..8404ee9b 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/validate.ts @@ -50,15 +50,17 @@ const validate = (() => { const _io0 = (input: any): boolean => "string" === typ value: input }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : undefined + data: input } as any; } return { success: true, - errors: [], data: input } as any; }; })(); diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js index dd0e5fcf..8ea1e890 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/alias.js @@ -237,15 +237,17 @@ const validate = /* @__PURE__ */ (() => { value: input2 }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; }; diff --git a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js index a4a35424..d6936877 100644 --- a/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js +++ b/packages/unplugin-typia/tests/fixtures/__snapshots__/vite/validate.js @@ -114,15 +114,17 @@ const validate = /* @__PURE__ */ (() => { value: input2 }))(input, "$input", true); const success = 0 === errors.length; - return { + return success ? { + success, + data: input + } : { success, errors, - data: success ? input : void 0 + data: input }; } return { success: true, - errors: [], data: input }; };