Skip to content

Commit 0013630

Browse files
committed
.zosattributes for all
Signed-off-by: Paul Cooper <[email protected]>
1 parent cb9031e commit 0013630

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

__tests__/api/BundleContent/BundleMocked.test.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ describe("MockedFilesystemTests", () => {
2222

2323
it("should tolerate META-INF directory not existing", () => {
2424
// Mocks for the manifest - META-INF exists
25-
jest.spyOn(fs, "existsSync").mockImplementationOnce(() => ( false ));
25+
jest.spyOn(fs, "existsSync").mockImplementation((path: string) => {
26+
if (path.endsWith("META-INF")) {
27+
return false;
28+
}
29+
if (path.endsWith(".zosattributes")) {
30+
return false;
31+
}
32+
return true;
33+
});
34+
2635
// Mocks for the manifest - Bundle dir writable
2736
jest.spyOn(fs, "accessSync").mockImplementationOnce(() => ( true ));
2837

@@ -355,6 +364,9 @@ describe("MockedFilesystemTests", () => {
355364
}
356365
return true;
357366
});
367+
jest.spyOn(fs, "writeFileSync").mockImplementation((path: string) => {
368+
return true;
369+
});
358370

359371
jest.spyOn(fs, "mkdirSync").mockImplementationOnce(() => { throw new Error("InjectedError"); });
360372

@@ -383,7 +395,11 @@ describe("MockedFilesystemTests", () => {
383395
});
384396

385397
// Mocks for the manifest - manifest write
386-
jest.spyOn(fs, "writeFileSync").mockImplementationOnce(() => { throw new Error("InjectedError"); });
398+
jest.spyOn(fs, "writeFileSync").mockImplementation((path: string) => {
399+
if (path.endsWith("cics.xml")) {
400+
throw new Error("InjectedError");
401+
}
402+
});
387403

388404

389405
let err: Error;
@@ -408,6 +424,9 @@ describe("MockedFilesystemTests", () => {
408424
}
409425
return true;
410426
});
427+
jest.spyOn(fs, "writeFileSync").mockImplementation((path: string) => {
428+
return true;
429+
});
411430

412431
jest.spyOn(fs, "mkdirSync").mockImplementationOnce(() => { throw new Error("InjectedError"); });
413432

@@ -434,9 +453,11 @@ describe("MockedFilesystemTests", () => {
434453
}
435454
return true;
436455
});
437-
438-
// Mocks for the nodejsapp - write .nodejsapp file)
439-
jest.spyOn(fs, "writeFileSync").mockImplementationOnce(() => { throw new Error("InjectedError"); });
456+
jest.spyOn(fs, "writeFileSync").mockImplementation((path: string) => {
457+
if (path.endsWith(".nodejsapp")) {
458+
throw new Error("InjectedError");
459+
}
460+
});
440461

441462
let err: Error;
442463
try {

src/api/BundleContent/Bundle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ node_modules -
8686
this.manifest = new Manifest(this.bundleDirectory, this.merge, this.overwrite, params);
8787
this.preparedToSave = false;
8888
this.zosAttribsFile = this.path.join(this.bundleDirectory, ".zosattributes");
89+
this.zosAttribsNeeded = true;
8990
}
9091

9192
/**

0 commit comments

Comments
 (0)