-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c147034
commit e0c1087
Showing
6 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { infoPlistFactory } from './infoPlist'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { InfoPlist } from '@/src/types'; | ||
import { faker } from '@faker-js/faker'; | ||
import { Factory } from 'fishery'; | ||
|
||
export const infoPlistFactory = Factory.define<InfoPlist>(() => { | ||
const appName = faker.word.noun(); | ||
const domain = faker.internet.domainName(); | ||
const bundleId = domain.split(',').reverse().join('.') + '.' + appName; | ||
|
||
return { | ||
CFBundleDisplayName: appName, | ||
CFBundleIdentifier: bundleId, | ||
CFBundleName: appName, | ||
CFBundleShortVersionString: faker.system.semver(), | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// import cp from 'node:child_process'; | ||
import { infoPlistFactory } from '@/tests/factories'; | ||
import { describe, expect, test } from '@jest/globals'; | ||
|
||
describe('Info.plist factory tests', () => { | ||
test('can generate an object', () => { | ||
infoPlistFactory.build(); | ||
}); | ||
|
||
test('generated plist has uniform app name', () => { | ||
const infoPlist = infoPlistFactory.build(); | ||
const name = infoPlist.CFBundleName; | ||
|
||
expect(infoPlist.CFBundleDisplayName).toBe(name); | ||
expect(infoPlist.CFBundleIdentifier).toContain(name); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters