forked from Azure/autorest.typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnameChecker.spec.ts
53 lines (42 loc) · 1.33 KB
/
nameChecker.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { SearchClient } from "./generated/nameChecker/src";
import { assert } from "chai";
import * as fs from "fs";
describe("Integration tests for NameChecker", () => {
let client: SearchClient;
it("should create a client successfully", async () => {
client = new SearchClient("sampleEndPoint", "sampleIndexName");
assert.notEqual(client, null);
});
it("should check for naming overrides in models index file", async () => {
const content: string = fs.readFileSync(
"./test/integration/generated/nameChecker/src/models/index.ts",
"utf-8"
);
let containsHidden = content.includes("readonly _score: number;");
assert.equal(
containsHidden,
true,
"Expected _score naming override missing"
);
containsHidden = content.includes(
"readonly _highlights?: { [propertyName: string]: string[] };"
);
assert.equal(
containsHidden,
true,
"Expected _highlights naming override missing"
);
containsHidden = content.includes("__actionType: IndexActionType;");
assert.equal(
containsHidden,
true,
"Expected __actionType naming override missing"
);
containsHidden = content.includes("readonly _text: string;");
assert.equal(
containsHidden,
true,
"Expected _text naming override missing"
);
});
});