forked from oakserver/oak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_test.ts
43 lines (40 loc) · 1.82 KB
/
mod_test.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
// Copyright 2018-2021 the oak authors. All rights reserved. MIT license.
import { assert, assertEquals } from "./test_deps.ts";
import * as mod from "./mod.ts";
const { test } = Deno;
test({
name: "public API assertions",
fn() {
assert(mod != null);
assertEquals(typeof mod.Application, "function");
assertEquals(typeof mod.Context, "function");
assertEquals(typeof mod.etag, "object");
assertEquals(typeof mod.etag.calculate, "function");
assertEquals(typeof mod.etag.factory, "function");
assertEquals(typeof mod.FormDataReader, "function");
assertEquals(typeof mod.helpers, "object");
assertEquals(typeof mod.helpers.getQuery, "function");
assertEquals(Object.keys(mod.helpers).length, 1);
assertEquals(typeof mod.HttpError, "function");
assertEquals(typeof mod.httpErrors, "object");
assertEquals(typeof mod.HttpServerNative, "function");
assertEquals(typeof mod.HttpServerStd, "function");
assertEquals(typeof mod.isErrorStatus, "function");
assertEquals(typeof mod.isHttpError, "function");
assertEquals(typeof mod.isRedirectStatus, "function");
assertEquals(typeof mod.composeMiddleware, "function");
assertEquals(typeof mod.Cookies, "function");
assertEquals(typeof mod.ifRange, "function");
assertEquals(typeof mod.MultiPartStream, "function");
assertEquals(typeof mod.parseRange, "function");
assertEquals(typeof mod.REDIRECT_BACK, "symbol");
assertEquals(typeof mod.Request, "function");
assertEquals(typeof mod.Response, "function");
assertEquals(typeof mod.Router, "function");
assertEquals(typeof mod.ServerSentEvent, "function");
assertEquals(typeof mod.STATUS_TEXT, "object");
assertEquals(typeof mod.Status, "object");
assertEquals(typeof mod.send, "function");
assertEquals(Object.keys(mod).length, 25);
},
});