Skip to content

Commit 721867e

Browse files
committed
chore(appresorces): fix tests
1 parent bac6571 commit 721867e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

test/platform-service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ describe('Platform Service Tests', () => {
394394

395395
const appDestFolderPath = path.join(tempFolder, "appDest");
396396
const appResourcesFolderPath = path.join(appDestFolderPath, "App_Resources");
397+
const appResourcesPath = path.join(appFolderPath, "App_Resources/Android");
398+
fs.createDirectory(appResourcesPath);
399+
fs.writeFile(path.join(appResourcesPath, "test.txt"), "test");
397400
fs.writeJson(path.join(tempFolder, "package.json"), {
398401
name: "testname",
399402
nativescript: {
@@ -859,11 +862,12 @@ describe('Platform Service Tests', () => {
859862
projectRoot: testDirData.tempFolder,
860863
platformProjectService: {
861864
prepareProject: (): any => null,
865+
prepareAppResources: (): any => null,
862866
validate: () => Promise.resolve(),
863867
createProject: (projectRoot: string, frameworkDir: string) => Promise.resolve(),
864868
interpolateData: (projectRoot: string) => Promise.resolve(),
865869
afterCreateProject: (projectRoot: string): any => null,
866-
getAppResourcesDestinationDirectoryPath: () => "",
870+
getAppResourcesDestinationDirectoryPath: () => testDirData.appResourcesFolderPath,
867871
processConfigurationFilesFromAppResources: () => Promise.resolve(),
868872
ensureConfigurationFileInAppResources: (): any => null,
869873
interpolateConfigurationFile: (): void => undefined,

test/stubs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ export class ProjectDataStub implements IProjectData {
256256
appDirectoryPath: string;
257257
devDependencies: IStringDictionary;
258258
projectType: string;
259+
get appResourcesDirectoryPath(): string {
260+
return this.getAppResourcesDirectoryPath();
261+
}
259262
public initializeProjectData(projectDir?: string): void {
260263
this.projectDir = this.projectDir || projectDir;
261264
}

0 commit comments

Comments
 (0)