Skip to content

Commit a9b2241

Browse files
update test examples
1 parent 923899f commit a9b2241

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/cli/src/commands/dns/record/scan-records.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const SOA = 16;
1313
const zone = {
1414
Id: 1,
1515
Domain: "example.com",
16-
Records: [{ Type: RECORD_TYPES.A, Name: "dup", Value: "1.2.3.4" }],
16+
Records: [{ Type: RECORD_TYPES.A, Name: "dup", Value: "192.0.2.4" }],
1717
} as never;
1818

1919
describe("discoverImportableRecords", () => {
2020
test("maps apex, drops SOA/NS, and skips records that already exist", async () => {
2121
discovered = [
22-
{ Type: RECORD_TYPES.A, Name: "@", Value: "1.1.1.1", Ttl: 300 },
22+
{ Type: RECORD_TYPES.A, Name: "@", Value: "192.0.2.1", Ttl: 300 },
2323
{ Type: RECORD_TYPES.CNAME, Name: "www", Value: "example.com" },
2424
{
2525
Type: RECORD_TYPES.MX,
@@ -29,7 +29,7 @@ describe("discoverImportableRecords", () => {
2929
},
3030
{ Type: SOA, Name: "@", Value: "ns root soa" },
3131
{ Type: RECORD_TYPES.NS, Name: "@", Value: "ns1.other.com" },
32-
{ Type: RECORD_TYPES.A, Name: "dup", Value: "1.2.3.4" },
32+
{ Type: RECORD_TYPES.A, Name: "dup", Value: "192.0.2.4" },
3333
];
3434

3535
const records = await discoverImportableRecords({} as never, zone);
@@ -147,7 +147,7 @@ describe("discoverImportableRecords", () => {
147147
discovered = [
148148
{ Type: RECORD_TYPES.NS, Name: "@", Value: "ns1.other.com" },
149149
{ Type: SOA, Name: "@", Value: "soa" },
150-
{ Type: RECORD_TYPES.A, Name: "dup", Value: "1.2.3.4" },
150+
{ Type: RECORD_TYPES.A, Name: "dup", Value: "192.0.2.4" },
151151
];
152152
expect(await discoverImportableRecords({} as never, zone)).toHaveLength(0);
153153
});

packages/cli/src/core/hostnames/bunny-dns.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe("findBunnyDnsZone", () => {
9090

9191
test("leaves existing null when no record matches the name", async () => {
9292
const client = fakeClient([{ Id: 7, Domain: "example.com" }], {
93-
7: [{ Id: 99, Type: 0, Name: "www", Value: "1.2.3.4" }],
93+
7: [{ Id: 99, Type: 0, Name: "www", Value: "192.0.2.4" }],
9494
});
9595
const match = await findBunnyDnsZone(client, "shop.example.com");
9696
expect(match?.existing).toBeNull();
@@ -131,7 +131,7 @@ describe("offerBunnyDnsRecord", () => {
131131
zoneId: 7,
132132
zoneDomain: "example.com",
133133
recordName: "shop",
134-
existing: { Type: 0, Name: "shop", Value: "1.2.3.4" },
134+
existing: { Type: 0, Name: "shop", Value: "192.0.2.4" },
135135
delegated: true,
136136
},
137137
}),
@@ -145,7 +145,7 @@ describe("offerBunnyDnsThenSsl", () => {
145145
// confirms the repoint, the failure must propagate, not fall back to manual DNS.
146146
prompts.inject([true]);
147147
const client = fakeClient([{ Id: 7, Domain: "example.com" }], {
148-
7: [{ Type: 0, Name: "shop", Value: "1.2.3.4" }],
148+
7: [{ Type: 0, Name: "shop", Value: "192.0.2.4" }],
149149
});
150150

151151
await expect(

packages/cli/src/core/hostnames/dns.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("dnsPointsAt", () => {
3131
const r = resolver({
3232
resolveCname: async () => ["other.example.net"],
3333
resolve4: async (host) =>
34-
host === "my-script-e9g0r.b-cdn.net" ? ["1.1.1.1"] : ["9.9.9.9"],
34+
host === "my-script-e9g0r.b-cdn.net" ? ["192.0.2.1"] : ["203.0.113.9"],
3535
});
3636
expect(
3737
await dnsPointsAt("shop.example.com", "my-script-e9g0r.b-cdn.net", r),
@@ -41,7 +41,7 @@ describe("dnsPointsAt", () => {
4141
test("falls back to shared A records when no CNAME exists (flattened DNS)", async () => {
4242
const r = resolver({
4343
resolve4: async (host) =>
44-
host === "shop.example.com" ? ["1.1.1.1", "2.2.2.2"] : ["2.2.2.2"],
44+
host === "shop.example.com" ? ["192.0.2.1", "192.0.2.2"] : ["192.0.2.2"],
4545
});
4646
expect(
4747
await dnsPointsAt("shop.example.com", "my-script-e9g0r.b-cdn.net", r),
@@ -61,7 +61,7 @@ describe("dnsPointsAt", () => {
6161
test("returns false when A records differ", async () => {
6262
const r = resolver({
6363
resolve4: async (host) =>
64-
host === "shop.example.com" ? ["3.3.3.3"] : ["4.4.4.4"],
64+
host === "shop.example.com" ? ["192.0.2.3"] : ["203.0.113.4"],
6565
});
6666
expect(
6767
await dnsPointsAt("shop.example.com", "my-script-e9g0r.b-cdn.net", r),

0 commit comments

Comments
 (0)