We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent baf4e35 commit 887eb08Copy full SHA for 887eb08
application/domain/tests/static.test.js
@@ -2,6 +2,20 @@
2
name: 'Static server test',
3
4
async run(t) {
5
+ await t.test('Test to serve without cache', async (t) => {
6
+ const filePath = './application/static/demo.txt';
7
+ const url = 'http://127.0.0.1:8000/demo.txt';
8
+ await node.fsp.unlink(filePath).catch(() => null);
9
+ t.after(() => {
10
+ node.fsp.unlink(filePath);
11
+ });
12
+ const data = node.crypto.randomBytes(1024 * 1024);
13
+ await node.fsp.writeFile(filePath, data);
14
+ const response = await fetch(url);
15
+ const msg = `status: ${response.status} expected: 200`;
16
+ node.assert.strictEqual(response.status, 200, msg);
17
18
+
19
const tasks = [
20
{ url: '/', size: 2099 },
21
{ url: '/console.js', size: 14366 },
0 commit comments