-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Typesense.spec.js
52 lines (46 loc) · 1.17 KB
/
Typesense.spec.js
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
import chai from "chai";
import {
Client as TypesenseClient,
SearchClient as TypesenseSearchClient,
Errors,
} from "../src/Typesense";
let expect = chai.expect;
describe("Typesense", function () {
it("should have a Client object that can be instantiated", function (done) {
let client = new TypesenseClient({
nodes: [
{
host: "node0",
port: "8108",
protocol: "http",
},
],
apiKey: "abcd",
randomizeNodes: false,
});
expect(client.configuration).to.be.an("object");
done();
});
it("should have a SearchClient object that can be instantiated", function (done) {
let client = new TypesenseSearchClient({
nodes: [
{
host: "node0",
port: "8108",
protocol: "http",
},
],
apiKey: "abcd",
randomizeNodes: false,
});
expect(client.configuration).to.be.an("object");
done();
});
it("should have all the custom error objects", function (done) {
// Just to make sure the object is available
expect(new Errors.TypesenseError()).to.be.an.instanceof(
Errors.TypesenseError
);
done();
});
});