Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions apps/mobile/app.config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { afterEach, describe, expect, it, vi } from "vite-plus/test";

const originalAppVariant = process.env.APP_VARIANT;

afterEach(() => {
if (originalAppVariant === undefined) {
delete process.env.APP_VARIANT;
} else {
process.env.APP_VARIANT = originalAppVariant;
}

vi.resetModules();
});

async function loadConfigForVariant(appVariant: string) {
process.env.APP_VARIANT = appVariant;
vi.resetModules();

const module = await import("./app.config");
return module.default;
}

describe("mobile app config", () => {
it("configures development iOS builds with a bundle-scoped Keychain access group", async () => {
const config = await loadConfigForVariant("development");

expect(config.ios?.bundleIdentifier).toBe("com.t3tools.t3code.dev");
expect(config.ios?.entitlements?.["keychain-access-groups"]).toEqual([
"$(AppIdentifierPrefix)com.t3tools.t3code.dev",
]);
});
});
3 changes: 3 additions & 0 deletions apps/mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ const config: ExpoConfig = {
`applinks:${variant.relyingParty}`,
`webcredentials:${variant.relyingParty}`,
],
entitlements: {
"keychain-access-groups": [`$(AppIdentifierPrefix)${variant.iosBundleIdentifier}`],
},
infoPlist: {
NSAppTransportSecurity: {
NSAllowsArbitraryLoads: true,
Expand Down
Loading