@mojojs/core 0.19.2 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app.d.ts +7 -0
- package/lib/app.js +13 -2
- package/lib/app.js.map +1 -1
- package/lib/cache.d.ts +23 -0
- package/lib/cache.js +45 -0
- package/lib/cache.js.map +1 -0
- package/lib/cli/create-full-app.js +2 -2
- package/lib/plugins/mt-engine.js +4 -5
- package/lib/plugins/mt-engine.js.map +1 -1
- package/lib/plugins/view-helpers.js +2 -1
- package/lib/plugins/view-helpers.js.map +1 -1
- package/lib/renderer.d.ts +38 -0
- package/lib/renderer.js +38 -0
- package/lib/renderer.js.map +1 -1
- package/lib/router/route.d.ts +83 -0
- package/lib/router/route.js +83 -0
- package/lib/router/route.js.map +1 -1
- package/lib/router.d.ts +38 -2
- package/lib/router.js +38 -2
- package/lib/router.js.map +1 -1
- package/lib/static.d.ts +3 -0
- package/lib/static.js +3 -0
- package/lib/static.js.map +1 -1
- package/lib/user-agent/test.d.ts +115 -2
- package/lib/user-agent/test.js +123 -10
- package/lib/user-agent/test.js.map +1 -1
- package/package.json +3 -5
package/lib/user-agent/test.js
CHANGED
|
@@ -5,9 +5,15 @@ import { MockUserAgent } from './mock.js';
|
|
|
5
5
|
import DOM from '@mojojs/dom';
|
|
6
6
|
import yaml from 'js-yaml';
|
|
7
7
|
import StackUtils from 'stack-utils';
|
|
8
|
+
/**
|
|
9
|
+
* Test user agent class.
|
|
10
|
+
*/
|
|
8
11
|
export class TestUserAgent extends MockUserAgent {
|
|
9
12
|
constructor(options = {}) {
|
|
10
13
|
super(options);
|
|
14
|
+
/**
|
|
15
|
+
* Current HTTP response content.
|
|
16
|
+
*/
|
|
11
17
|
this.body = Buffer.from('');
|
|
12
18
|
this._assert = undefined;
|
|
13
19
|
this._dom = undefined;
|
|
@@ -19,85 +25,146 @@ export class TestUserAgent extends MockUserAgent {
|
|
|
19
25
|
if (options.tap !== undefined)
|
|
20
26
|
this._prepareTap(options.tap);
|
|
21
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Delegate assertion to test framework currently in use.
|
|
30
|
+
*/
|
|
22
31
|
assert(name, args, msg, skip) {
|
|
23
32
|
const test = this._assert ?? assert;
|
|
24
33
|
test[name](...args, msg, { stack: this._stack.captureString(10, skip) });
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Check response content for exact match.
|
|
37
|
+
*/
|
|
26
38
|
bodyIs(body) {
|
|
27
39
|
this.assert('equal', [this.body.toString(), body], 'body is equal', this.bodyIs);
|
|
28
40
|
return this;
|
|
29
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Opposite of `bodyIs`.
|
|
44
|
+
*/
|
|
30
45
|
bodyIsnt(body) {
|
|
31
46
|
this.assert('not', [this.body.toString(), body], 'body is not equal', this.bodyIsnt);
|
|
32
47
|
return this;
|
|
33
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Check response content for similar match.
|
|
51
|
+
*/
|
|
34
52
|
bodyLike(regex) {
|
|
35
53
|
this.assert('match', [this.body.toString(), regex], 'body is similar', this.bodyLike);
|
|
36
54
|
return this;
|
|
37
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Opposite of `bodyLike`.
|
|
58
|
+
*/
|
|
38
59
|
bodyUnlike(regex) {
|
|
39
60
|
this.assert('notMatch', [this.body.toString(), regex], 'body is not similar', this.bodyUnlike);
|
|
40
61
|
return this;
|
|
41
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Close WebSocket connection gracefully.
|
|
65
|
+
*/
|
|
42
66
|
async closeOk(code, reason) {
|
|
43
67
|
this.ws.close(code, reason);
|
|
44
68
|
await this._waitFinished();
|
|
45
69
|
this.assert('ok', [true], 'closed WebSocket', this.closeOk);
|
|
46
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Wait for WebSocket connection to be closed gracefully and check status.
|
|
73
|
+
*/
|
|
47
74
|
async closedOk(code) {
|
|
48
75
|
await this._waitFinished();
|
|
49
76
|
const finished = this._finished == null ? null : this._finished[0];
|
|
50
77
|
this.assert('equal', [finished, code], `WebSocket closed with status ${code}`, this.closedOk);
|
|
51
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Perform a `DELETE` request and check for transport errors.
|
|
81
|
+
*/
|
|
52
82
|
async deleteOk(url, options) {
|
|
53
83
|
return await this._requestOk(this.deleteOk, 'DELETE', url, options);
|
|
54
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Checks for existence of the CSS selectors first matching HTML/XML element.
|
|
87
|
+
*/
|
|
55
88
|
elementExists(selector) {
|
|
56
89
|
const elements = this._html.find(selector);
|
|
57
90
|
this.assert('ok', [elements.length > 0], `element for selector "${selector}" exists`, this.elementExists);
|
|
58
91
|
return this;
|
|
59
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Opposite of `elementExists`.
|
|
95
|
+
*/
|
|
60
96
|
elementExistsNot(selector) {
|
|
61
97
|
const elements = this._html.find(selector);
|
|
62
98
|
this.assert('ok', [elements.length === 0], `no element for selector "${selector}"`, this.elementExistsNot);
|
|
63
99
|
return this;
|
|
64
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Perform a `GET` request and check for transport errors.
|
|
103
|
+
*/
|
|
65
104
|
async getOk(url, options) {
|
|
66
105
|
return await this._requestOk(this.getOk, 'GET', url, options);
|
|
67
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Perform a `HEAD` request and check for transport errors.
|
|
109
|
+
*/
|
|
68
110
|
async headOk(url, options) {
|
|
69
111
|
return await this._requestOk(this.headOk, 'HEAD', url, options);
|
|
70
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Check if response header exists.
|
|
115
|
+
*/
|
|
71
116
|
headerExists(name) {
|
|
72
117
|
this.assert('ok', [this.res.get(name) !== undefined], `header "${name}" exists`, this.headerExists);
|
|
73
118
|
return this;
|
|
74
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Opposite of `headerExists`.
|
|
122
|
+
*/
|
|
75
123
|
headerExistsNot(name) {
|
|
76
124
|
this.assert('notOk', [this.res.get(name) !== undefined], `no "${name}" header`, this.headerExistsNot);
|
|
77
125
|
return this;
|
|
78
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Check response header for exact match.
|
|
129
|
+
*/
|
|
79
130
|
headerIs(name, value) {
|
|
80
131
|
this.assert('equal', [this.res.get(name), value], `${name}: ${value}`, this.headerIs);
|
|
81
132
|
return this;
|
|
82
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Opposite of `headerIs`.
|
|
136
|
+
*/
|
|
83
137
|
headerIsnt(name, value) {
|
|
84
138
|
this.assert('not', [this.res.get(name), value], `not ${name}: ${value}`, this.headerIsnt);
|
|
85
139
|
return this;
|
|
86
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Check response header for similar match.
|
|
143
|
+
*/
|
|
87
144
|
headerLike(name, regex) {
|
|
88
145
|
this.assert('match', [this.res.get(name), regex], `${name} is similar`, this.headerLike);
|
|
89
146
|
return this;
|
|
90
147
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
148
|
+
/**
|
|
149
|
+
* Check if JSON response contains a value that can be identified using the given JSON Pointer.
|
|
150
|
+
*/
|
|
96
151
|
jsonHas(pointer) {
|
|
97
152
|
const has = jsonPointer(JSON.parse(this.body.toString()), pointer) !== undefined;
|
|
98
153
|
this.assert('ok', [has], `has value for JSON Pointer "${pointer}" (JSON)`, this.jsonHas);
|
|
99
154
|
return this;
|
|
100
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Check the value extracted from JSON response using the given JSON Pointerr, which defaults to the root value if it
|
|
158
|
+
* is omitted.
|
|
159
|
+
*/
|
|
160
|
+
jsonIs(value, pointer = '') {
|
|
161
|
+
const expected = jsonPointer(JSON.parse(this.body.toString()), pointer);
|
|
162
|
+
this.assert('same', [expected, value], `exact match for JSON Pointer "${pointer}" (JSON)`, this.jsonIs);
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Wait for next WebSocket message to arrive.
|
|
167
|
+
*/
|
|
101
168
|
async messageOk() {
|
|
102
169
|
if (this._messages === undefined)
|
|
103
170
|
throw new Error('No active WebSocket connection');
|
|
@@ -105,48 +172,84 @@ export class TestUserAgent extends MockUserAgent {
|
|
|
105
172
|
this.assert('ok', [true], 'message received', this.messageOk);
|
|
106
173
|
return message;
|
|
107
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Create a new test user agent.
|
|
177
|
+
*/
|
|
108
178
|
static async newTestUserAgent(app, options) {
|
|
109
179
|
app.exceptionFormat = 'txt';
|
|
110
180
|
return await new TestUserAgent(options).start(app);
|
|
111
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Perform a `OPTIONS` request and check for transport errors.
|
|
184
|
+
*/
|
|
112
185
|
async optionsOk(url, options) {
|
|
113
186
|
return await this._requestOk(this.optionsOk, 'OPTIONS', url, options);
|
|
114
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Perform a `PATCH` request and check for transport errors.
|
|
190
|
+
*/
|
|
115
191
|
async patchOk(url, options) {
|
|
116
192
|
return await this._requestOk(this.patchOk, 'PATCH', url, options);
|
|
117
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Perform a `POST` request and check for transport errors.
|
|
196
|
+
*/
|
|
118
197
|
async postOk(url, options) {
|
|
119
198
|
return await this._requestOk(this.postOk, 'POST', url, options);
|
|
120
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Perform a `PUT` request and check for transport errors.
|
|
202
|
+
*/
|
|
121
203
|
async putOk(url, options) {
|
|
122
204
|
return await this._requestOk(this.putOk, 'PUT', url, options);
|
|
123
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Current HTTP response.
|
|
208
|
+
*/
|
|
124
209
|
get res() {
|
|
125
210
|
const res = this._res;
|
|
126
211
|
if (res === undefined)
|
|
127
212
|
throw new Error('No active HTTP response');
|
|
128
213
|
return res;
|
|
129
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Send message or frame via WebSocket.
|
|
217
|
+
*/
|
|
130
218
|
async sendOk(message) {
|
|
131
219
|
await this.ws.send(message);
|
|
132
220
|
this.assert('ok', [true], 'send message', this.sendOk);
|
|
133
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Check response status for exact match.
|
|
224
|
+
*/
|
|
134
225
|
statusIs(status) {
|
|
135
226
|
this.assert('equal', [this.res.status, status], `response status is ${status}`, this.statusIs);
|
|
136
227
|
return this;
|
|
137
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Checks text content of the CSS selectors first matching HTML/XML element for similar match.
|
|
231
|
+
*/
|
|
138
232
|
textLike(selector, regex) {
|
|
139
233
|
this.assert('match', [this._html.at(selector)?.text() ?? '', regex], `similar match for selector "${selector}"`, this.textLike);
|
|
140
234
|
return this;
|
|
141
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Check response `Content-Type` header for exact match.
|
|
238
|
+
*/
|
|
142
239
|
typeIs(value) {
|
|
143
240
|
this.assert('equal', [this.res.type, value], `Content-Type: ${value}`, this.typeIs);
|
|
144
241
|
return this;
|
|
145
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Check response `Content-Type` header for similar match.
|
|
245
|
+
*/
|
|
146
246
|
typeLike(regex) {
|
|
147
247
|
this.assert('match', [this.res.type, regex], 'Content-Type is similar', this.typeLike);
|
|
148
248
|
return this;
|
|
149
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Open a WebSocket connection with transparent handshake.
|
|
252
|
+
*/
|
|
150
253
|
async websocketOk(url, options) {
|
|
151
254
|
const ws = (this._ws = await this.websocket(url, options));
|
|
152
255
|
this._res = ws.handshake ?? undefined;
|
|
@@ -155,22 +258,32 @@ export class TestUserAgent extends MockUserAgent {
|
|
|
155
258
|
this._messages = on(this.ws, 'message');
|
|
156
259
|
this.assert('ok', [true], `WebSocket handshake with ${url.toString()}`, this.websocketOk);
|
|
157
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Active WebSocket connection.
|
|
263
|
+
*/
|
|
158
264
|
get ws() {
|
|
159
265
|
const ws = this._ws;
|
|
160
266
|
if (ws === undefined)
|
|
161
267
|
throw new Error('No active WebSocket connection');
|
|
162
268
|
return ws;
|
|
163
269
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return this;
|
|
168
|
-
}
|
|
270
|
+
/**
|
|
271
|
+
* Check if YAML response contains a value that can be identified using the given JSON Pointer.
|
|
272
|
+
*/
|
|
169
273
|
yamlHas(pointer) {
|
|
170
274
|
const has = jsonPointer(yaml.load(this.body.toString()), pointer) !== undefined;
|
|
171
275
|
this.assert('ok', [has], `has value for JSON Pointer "${pointer}" (YAML)`, this.jsonHas);
|
|
172
276
|
return this;
|
|
173
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Check the value extracted from YAML response using the given JSON Pointerr, which defaults to the root value if it
|
|
280
|
+
* is omitted.
|
|
281
|
+
*/
|
|
282
|
+
yamlIs(value, pointer = '') {
|
|
283
|
+
const expected = jsonPointer(yaml.load(this.body.toString()), pointer);
|
|
284
|
+
this.assert('same', [expected, value], `exact match for JSON Pointer "${pointer}" (YAML)`, this.yamlIs);
|
|
285
|
+
return this;
|
|
286
|
+
}
|
|
174
287
|
get _html() {
|
|
175
288
|
if (this._dom === undefined)
|
|
176
289
|
this._dom = new DOM((this.body ?? '').toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/user-agent/test.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,EAAE,EAAC,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AACvC,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,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;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CACd,IAAkB,EAClB,MAAc,EACd,GAAiB,EACjB,OAAiC;QAEjC,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,gBAAgB,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI;YAAE,OAAO;QACnC,OAAO,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YACjC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;gBACzB,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojojs/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Real-time web framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
53
53
|
"@types/busboy": "^1.3.0",
|
|
54
54
|
"@types/js-yaml": "^4.0.3",
|
|
55
|
-
"@types/lru-cache": "^5.1.0",
|
|
56
55
|
"@types/mime-types": "^2.1.0",
|
|
57
56
|
"@types/node": "^17.0.0",
|
|
58
57
|
"@types/nopt": "^3.0.29",
|
|
@@ -76,15 +75,14 @@
|
|
|
76
75
|
"node": ">= 16"
|
|
77
76
|
},
|
|
78
77
|
"dependencies": {
|
|
79
|
-
"@mojojs/dom": "^1.
|
|
78
|
+
"@mojojs/dom": "^1.2.0",
|
|
80
79
|
"@mojojs/path": "^1.4.0",
|
|
81
|
-
"@mojojs/template": "^1.
|
|
80
|
+
"@mojojs/template": "^1.6.0",
|
|
82
81
|
"ajv": "^8.5.0",
|
|
83
82
|
"busboy": "^1.0.0",
|
|
84
83
|
"chalk": "^5.0.0",
|
|
85
84
|
"form-data": "^4.0.0",
|
|
86
85
|
"js-yaml": "^4.1.0",
|
|
87
|
-
"lru-cache": "^6.0.0",
|
|
88
86
|
"mime-types": "^2.1.30",
|
|
89
87
|
"nopt": "^5.0.0",
|
|
90
88
|
"stack-utils": "^2.0.3",
|