unity-builder/src/model/__mocks__/versioning.ts

39 lines
1.8 KiB
TypeScript
Raw Normal View History

Initial Support for MacOS IL2CPP Builds (#326) * Add intial framework for macos builds. Test install editor * Fix unity hub path space * Single quote space in path * Escape space character * More backslashes * Move to bash scripts for setup * Add path to command args * Different command to run shell script * Use full path to scripts * Unpack changeset value and fix missing escape characters * Print changeset * More debug * Remove debug * Fix script paths * Printenv debug * Write environment variables to file to read in bash script * Debug file write * More debug * Fix missing await * Move back to process.env * Fix path typo * Add missing flags * Make directory for license activation * Add missing sudo * Give permissions to license folder * Fix path issues * Add build tests * Try ts setup again * Try quoting path * Further migrate mac scripts to align with linux scripts * print pwd * Fix changeset and remove unneeded env vars * Ignore return code * fix missing current directory * Fix project path * pwd * Remove project path * Revert to cwd being the workspace folder and pass action folder as an env variable. * Add blank project to use for activation * Add blank project path * Fix build tests * Don't rebuild library on windows * Fix project path windows * Fix platform specific workspace env variable * Fix incorrect variable name * Update .github/workflows/mac-build-tests.yml Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update .github/workflows/mac-build-tests.yml Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update dist/BlankProject/Packages/packages-lock.json Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update src/model/platform-setup/setup-mac.ts Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update src/model/platform-setup/setup-mac.ts Co-authored-by: Webber Takken <webber.nl@gmail.com> * Fix formatting Co-authored-by: Webber Takken <webber.nl@gmail.com>
2022-02-02 09:15:37 +00:00
/* eslint unicorn/prevent-abbreviations: "off" */
// Import these named export into your test file:
export const mockProjectPath = jest.fn().mockResolvedValue('mockProjectPath');
export const mockIsDirtyAllowed = jest.fn().mockResolvedValue(false);
export const mockBranch = jest.fn().mockResolvedValue('mockBranch');
export const mockHeadRef = jest.fn().mockResolvedValue('mockHeadRef');
export const mockRef = jest.fn().mockResolvedValue('mockRef');
export const mockDetermineVersion = jest.fn().mockResolvedValue('1.2.3');
export const mockGenerateSemanticVersion = jest.fn().mockResolvedValue('2.3.4');
export const mockGenerateTagVersion = jest.fn().mockResolvedValue('1.0');
export const mockParseSemanticVersion = jest.fn().mockResolvedValue({});
export const mockFetch = jest.fn().mockImplementation(() => {});
export const mockGetVersionDescription = jest.fn().mockResolvedValue('1.2-3-g12345678-dirty');
export const mockIsDirty = jest.fn().mockResolvedValue(false);
export const mockGetTag = jest.fn().mockResolvedValue('v1.0');
export const mockHasAnyVersionTags = jest.fn().mockResolvedValue(true);
export const mockGetTotalNumberOfCommits = jest.fn().mockResolvedValue(3);
export const mockGit = jest.fn().mockImplementation(() => {});
export default {
projectPath: mockProjectPath,
isDirtyAllowed: mockIsDirtyAllowed,
branch: mockBranch,
headRef: mockHeadRef,
ref: mockRef,
determineVersion: mockDetermineVersion,
generateSemanticVersion: mockGenerateSemanticVersion,
generateTagVersion: mockGenerateTagVersion,
parseSemanticVersion: mockParseSemanticVersion,
fetch: mockFetch,
getVersionDescription: mockGetVersionDescription,
isDirty: mockIsDirty,
getTag: mockGetTag,
hasAnyVersionTags: mockHasAnyVersionTags,
getTotalNumberOfCommits: mockGetTotalNumberOfCommits,
git: mockGit,
};