Skip to content

Commit

Permalink
add empty str test
Browse files Browse the repository at this point in the history
  • Loading branch information
elringus committed Mar 7, 2024
1 parent 4e8699f commit 5eb5079
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"build": "sh scripts/build.sh"
},
"devDependencies": {
"typescript": "^5.3.3",
"@types/node": "^20.11.5",
"typescript": "^5.4.2",
"@types/node": "^20.11.25",
"@types/ws": "^8.5.10",
"vitest": "^1.2.1",
"@vitest/coverage-v8": "^1.2.1",
"vitest": "^1.3.1",
"@vitest/coverage-v8": "^1.3.1",
"ws": "^8.16.0"
}
}
3 changes: 3 additions & 0 deletions src/js/test/cs/Test.Types/Vehicle/Registry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ public static async Task<IReadOnlyDictionary<string, Registry>> MapRegistriesAsy

[JSFunction]
public static partial IReadOnlyDictionary<string, Registry> GetRegistryMap ();

[JSInvokable]
public static Vehicle GetWithEmptyId () => new() { Id = "" };
}
6 changes: 6 additions & 0 deletions src/js/test/spec/interop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,10 @@ describe("while bootsharp is booted", () => {
expect(result1).toStrictEqual("foobar");
expect(result2).toStrictEqual("baznya");
});
it("empty string of a struct is transferred correctly", () => {
const id = Test.Types.Registry.getWithEmptyId().id;
expect(id).not.toBeNull();
expect(id).not.toBeUndefined();
expect(id).toStrictEqual("");
});
});

0 comments on commit 5eb5079

Please sign in to comment.