- Introduced `.prettierrc.json` to enforce consistent code formatting across the project. - Updated unit and e2e test files to address formatting issues, improve readability, and ensure alignment with the new Prettier configuration.
20 lines
1.0 KiB
JavaScript
20 lines
1.0 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const source = readFileSync(join(process.cwd(), "src/services/edgeGateways.js"), "utf8");
|
|
|
|
describe("edge gateway service contract", () => {
|
|
it("wraps the backend edge gateway REST endpoints", () => {
|
|
expect(source).toContain('"/departments"');
|
|
expect(source).toContain('"/edge-gateways"');
|
|
expect(source).toContain('"/edge-gateways/install-token"');
|
|
expect(source).toContain("/edge-gateways/${encodeURIComponent(gatewayId)}/discovery");
|
|
expect(source).toContain("/edge-gateways/${encodeURIComponent(gatewayId)}/bindings");
|
|
expect(source).toContain("/edge-gateways/${encodeURIComponent(gatewayId)}/update-jobs");
|
|
expect(source).toContain("/edge-gateways/${encodeURIComponent(gatewayId)}/shell-sessions");
|
|
expect(source).toContain("/edge-gateways/${encodeURIComponent(gatewayId)}/rotate-credentials");
|
|
expect(source).toContain("/departments/${encodeURIComponent(departmentId)}/gateway-cutover");
|
|
});
|
|
});
|