Skip to content

Commit

Permalink
Add TS error for setting the property.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Feb 29, 2024
1 parent d885671 commit 2abad39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions integration-tests/tests/src/tests/experimental/base-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe("Experimental", () => {
it("switches base URL", function (this: Mocha.Context) {
const app = new App("12345");
expect(app.baseUrl).equals("https://example");
// @ts-expect-error Assigning to read-only property.
expect(() => (app.baseUrl = "new URL")).to.throw("Cannot assign the base URL, please use `switchBaseUrl()`");
expect(app.baseUrl).equals("https://example");
// With the dummy implementation it doesn't actually switch anything.
Expand Down
2 changes: 1 addition & 1 deletion packages/realm/src/experimental/base-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ declare module "../app-services/App" {
/**
* Get the base URL.
*/
baseUrl: string;
get baseUrl(): string;
/**
* Switch the base URL.
*/
Expand Down

0 comments on commit 2abad39

Please sign in to comment.