Skip to content

Commit 5eb5079

Browse files
committed
add empty str test
1 parent 4e8699f commit 5eb5079

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/js/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"build": "sh scripts/build.sh"
77
},
88
"devDependencies": {
9-
"typescript": "^5.3.3",
10-
"@types/node": "^20.11.5",
9+
"typescript": "^5.4.2",
10+
"@types/node": "^20.11.25",
1111
"@types/ws": "^8.5.10",
12-
"vitest": "^1.2.1",
13-
"@vitest/coverage-v8": "^1.2.1",
12+
"vitest": "^1.3.1",
13+
"@vitest/coverage-v8": "^1.3.1",
1414
"ws": "^8.16.0"
1515
}
1616
}

src/js/test/cs/Test.Types/Vehicle/Registry.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@ public static async Task<IReadOnlyDictionary<string, Registry>> MapRegistriesAsy
4343

4444
[JSFunction]
4545
public static partial IReadOnlyDictionary<string, Registry> GetRegistryMap ();
46+
47+
[JSInvokable]
48+
public static Vehicle GetWithEmptyId () => new() { Id = "" };
4649
}

src/js/test/spec/interop.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,10 @@ describe("while bootsharp is booted", () => {
169169
expect(result1).toStrictEqual("foobar");
170170
expect(result2).toStrictEqual("baznya");
171171
});
172+
it("empty string of a struct is transferred correctly", () => {
173+
const id = Test.Types.Registry.getWithEmptyId().id;
174+
expect(id).not.toBeNull();
175+
expect(id).not.toBeUndefined();
176+
expect(id).toStrictEqual("");
177+
});
172178
});

0 commit comments

Comments
 (0)