Skip to content

Commit 2eaed6f

Browse files
committed
chore(appresorces): fix tests
1 parent b9dcae4 commit 2eaed6f

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
@@ -401,6 +401,9 @@ describe('Platform Service Tests', () => {
401401

402402
const appDestFolderPath = path.join(tempFolder, "appDest");
403403
const appResourcesFolderPath = path.join(appDestFolderPath, "App_Resources");
404+
const appResourcesPath = path.join(appFolderPath, "App_Resources/Android");
405+
fs.createDirectory(appResourcesPath);
406+
fs.writeFile(path.join(appResourcesPath, "test.txt"), "test");
404407
fs.writeJson(path.join(tempFolder, "package.json"), {
405408
name: "testname",
406409
nativescript: {
@@ -866,11 +869,12 @@ describe('Platform Service Tests', () => {
866869
projectRoot: testDirData.tempFolder,
867870
platformProjectService: {
868871
prepareProject: (): any => null,
872+
prepareAppResources: (): any => null,
869873
validate: () => Promise.resolve(),
870874
createProject: (projectRoot: string, frameworkDir: string) => Promise.resolve(),
871875
interpolateData: (projectRoot: string) => Promise.resolve(),
872876
afterCreateProject: (projectRoot: string): any => null,
873-
getAppResourcesDestinationDirectoryPath: () => "",
877+
getAppResourcesDestinationDirectoryPath: () => testDirData.appResourcesFolderPath,
874878
processConfigurationFilesFromAppResources: () => Promise.resolve(),
875879
ensureConfigurationFileInAppResources: (): any => null,
876880
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)