Skip to content

Commit c54f807

Browse files
committed
remove platform specific paths from expected results
1 parent 3f45182 commit c54f807

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

__tests__/api/BundleContent/AutoBundler.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,19 @@ describe("AutoBundler01", () => {
116116

117117
const parms: IHandlerParameters = DEFAULT_PARAMETERS;
118118
setCommonParmsForAutoBundleTests(parms);
119+
parms.arguments.nodejsapp = "MyExampleOverride";
119120
parms.arguments.startscript = "wibble";
120121

121-
await runAutoBundleWithError(parms, "__tests__/__resources__/ExampleBundle04");
122+
let err: Error;
123+
try {
124+
const ab = new AutoBundler("__tests__/__resources__/ExampleBundle01", parms);
125+
} catch (e) {
126+
err = e;
127+
}
128+
129+
expect(err).toBeDefined();
130+
expect(err.message).toContain("NODEJSAPP \"MyExampleOverride\" references a file outside of the Bundle directory:");
131+
expect(err.message).toContain("wibble");
122132
});
123133
it("should set a port number", async () => {
124134

__tests__/api/BundleContent/Bundle.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe("Bundle01", () => {
6767
}
6868

6969
// Check the output as JSON
70-
expect(err.message).toMatchSnapshot();
70+
expect(err).toBeDefined();
71+
expect(err.message).toContain("BundlePart \"name1\" references a file outside of the Bundle directory:");
72+
expect(err.message).toContain("cics.xml");
7173
});
7274
it("add a not found definition", () => {
7375

@@ -84,7 +86,9 @@ describe("Bundle01", () => {
8486
}
8587

8688
// Check the output as JSON
87-
expect(err.message).toMatchSnapshot();
89+
expect(err).toBeDefined();
90+
expect(err.message).toContain("BundlePart \"name1\" references a file that does not exist:");
91+
expect(err.message).toContain("Artefact3");
8892
});
8993
it("add a part with missing name", () => {
9094

__tests__/api/BundleContent/__snapshots__/AutoBundler.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ exports[`AutoBundler01 should set a nodejsapp name 2`] = `"{\\"manifest\\":{\\"x
2424

2525
exports[`AutoBundler01 should set a port number 1`] = `"Supplied Port is outside the range of 1-65535: -27"`;
2626

27-
exports[`AutoBundler01 should set a startscript name 1`] = `"NODEJSAPP \\"testBundleName\\" references a file outside of the Bundle directory: \\"..\\\\..\\\\..\\\\wibble\\"."`;
28-
2927
exports[`AutoBundler01 should set the bundle version 1`] = `"{\\"manifest\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle\\",\\"$t\\":\\"\\",\\"bundleMajorVer\\":3,\\"bundleMinorVer\\":4,\\"bundleMicroVer\\":5}}"`;
3028

3129
exports[`AutoBundler01 should set the bundleid 1`] = `"{\\"manifest\\":{\\"xmlns\\":\\"http://www.ibm.com/xmlns/prod/cics/bundle\\",\\"$t\\":\\"\\",\\"id\\":\\"test\\"}}"`;

__tests__/api/BundleContent/__snapshots__/Bundle.test.ts.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ exports[`Bundle01 add a NODEJSAPP 2`] = `
77
"
88
`;
99
10-
exports[`Bundle01 add a definition that references files outside of the bundle 1`] = `"BundlePart \\"name1\\" references a file outside of the Bundle directory: \\"..\\\\ExampleBundle01\\\\META-INF\\\\cics.xml\\"."`;
11-
12-
exports[`Bundle01 add a not found definition 1`] = `"BundlePart \\"name1\\" references a file that does not exist: \\"__tests__\\\\__resources__\\\\ExampleBundle02/Artefact3\\"."`;
13-
1410
exports[`Bundle01 add a part with missing name 1`] = `"BundlePart name is not set."`;
1511
1612
exports[`Bundle01 add a part with missing path 1`] = `"BundlePart path is not set for part \\"name1\\""`;

0 commit comments

Comments
 (0)