Skip to content

Commit 0c9e574

Browse files
committed
updated
1 parent 6c0299e commit 0c9e574

3 files changed

+13
-17
lines changed

e2e/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ const config = "samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml";
55
describe(config, () => {
66
performTests(config);
77
});
8-
9-
const duplicateChaincodeConfig = "samples/fablo-config-hlf2-2orgs-2chaincodes-private-data-duplicate.yaml";
10-
11-
describe(duplicateChaincodeConfig, () => {
12-
it("should throw an error for duplicate chaincode names across different channels", () => {
13-
expect(() => performTests(duplicateChaincodeConfig)).toThrowError(/Duplicate chaincode name found/);
14-
});
15-
});

e2e/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.test.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,4 @@ const config = "samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml";
44

55
describe(config, () => {
66
performTests(config);
7-
});
8-
9-
const duplicateChaincodeConfig = "samples/fablo-config-hlf2-2orgs-2chaincodes-raft-duplicate.yaml";
10-
11-
describe(duplicateChaincodeConfig, () => {
12-
it("should throw an error for duplicate chaincode names across different channels", () => {
13-
expect(() => performTests(duplicateChaincodeConfig)).toThrowError(/Duplicate chaincode name found/);
14-
});
15-
});
7+
});

e2e/fabloCommands.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ describe("validate", () => {
137137
expect(commandResult.output).toContain(" instance.orgs[0].organization.mspName : does not match pattern");
138138
expect(commands.getFiles()).toEqual([]);
139139
});
140+
141+
it("should throw an error for duplicate chaincode names across different channels", () => {
142+
// Given
143+
const fabloConfig = `${commands.relativeRoot}/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data-duplicate.yaml`;
144+
145+
// When
146+
const commandResult = commands.fabloExec(`validate ${fabloConfig}`);
147+
148+
// Then
149+
expect(commandResult).toEqual(TestCommands.failure());
150+
expect(commandResult.output).toContain("Duplicate chaincode name found");
151+
});
140152
});
141153

142154
describe("extend config", () => {

0 commit comments

Comments
 (0)