forked from farhoodlabs/paperclip
fix(plugin): harden kubernetes sandbox orchestration
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { deriveCompanySlug, deriveNamespaceName, newRunUlidDns, paperclipLabels } from "../../src/utils.js";
|
||||
|
||||
describe("deriveCompanySlug", () => {
|
||||
@@ -28,6 +28,13 @@ describe("newRunUlidDns", () => {
|
||||
const id = newRunUlidDns();
|
||||
expect(id).toMatch(/^[a-z0-9]{26}$/);
|
||||
});
|
||||
|
||||
it("does not use Math.random for the random suffix", () => {
|
||||
const spy = vi.spyOn(Math, "random");
|
||||
newRunUlidDns(() => 1);
|
||||
expect(spy).not.toHaveBeenCalled();
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
describe("paperclipLabels", () => {
|
||||
|
||||
Reference in New Issue
Block a user