Skip to content

Commit 830bd30

Browse files
committed
test: add test for obfuscated-endpoint-url
1 parent b3e26e1 commit 830bd30

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
query Customer($id: ID!) {
2+
customer(id: $id) {
3+
id
4+
name
5+
email
6+
address {
7+
city
8+
zip
9+
}
10+
}
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const fs = require("fs");
2+
const path = require("node:path");
3+
4+
const {
5+
deployAndRun,
6+
getTestDescription,
7+
} = require("../../../tests/gqltest.js");
8+
9+
testDescription = getTestDescription("snippets", __dirname);
10+
11+
const requestsFile = path.join(path.dirname(__dirname), "operations.graphql");
12+
const requests = fs.readFileSync(requestsFile, "utf8").toString();
13+
14+
describe(testDescription, function () {
15+
const tests = [
16+
{
17+
label: "customer",
18+
query: requests,
19+
operationName: "Customer",
20+
variables: {
21+
id: 1238,
22+
},
23+
expected: {
24+
customer: {
25+
id: "1238",
26+
name: "Baumbach",
27+
28+
address: {
29+
city: "New Schroeder",
30+
zip: "36897",
31+
},
32+
},
33+
},
34+
},
35+
];
36+
return deployAndRun(__dirname, tests);
37+
});

0 commit comments

Comments
 (0)