|
|
@ -11,10 +11,11 @@ describe("Docker names", () => {
|
|
|
|
|
|
|
|
|
|
|
|
test("should generate a random name with a number", () => {
|
|
|
|
test("should generate a random name with a number", () => {
|
|
|
|
const nameWithNumber = generateNameWithNumber();
|
|
|
|
const nameWithNumber = generateNameWithNumber();
|
|
|
|
const parts = nameWithNumber.split("-");
|
|
|
|
const parts = nameWithNumber.split("_");
|
|
|
|
expect(parts).toHaveLength(3);
|
|
|
|
expect(parts).toHaveLength(2);
|
|
|
|
expect(left).toContain(parts[0]);
|
|
|
|
const nameparts = parts[0].split("-");
|
|
|
|
expect(right).toContain(parts[1]);
|
|
|
|
expect(left).toContain(nameparts[0]);
|
|
|
|
expect(parseInt(parts[2])).toBeGreaterThan(0);
|
|
|
|
expect(right).toContain(nameparts[1]);
|
|
|
|
|
|
|
|
expect(parseInt(parts[1])).toBeGreaterThan(0);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|