Skip to content

Commit a9243bd

Browse files
committedOct 24, 2024
should work
but: nodejs/help#4298
1 parent 559fc47 commit a9243bd

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed
 

Diff for: ‎build/__tests__/stream-statics.test.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

Diff for: ‎build/__tests__/stream-statics.test.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import assert from 'node:assert';
2+
import { describe, it } from 'node:test';
3+
import { startServer } from '../stream-statics.js';
4+
import * as http from 'http';
5+
describe('Serving http', async () => {
6+
it('should bring up an http server', async (t) => {
7+
t.mock.method(http, 'createServer');
8+
await startServer({ protocol: 'http' });
9+
assert.strictEqual(http.createServer.mock.callCount(), 1);
10+
});
11+
});

Diff for: ‎build/__tests__/test.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"use strict";
22
import('./configuration.test.js');
3+
import('./stream-statics.test.js');

Diff for: ‎src/__tests__/stream-statics.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import assert from 'node:assert'
2+
import { describe, it, mock } from 'node:test'
3+
import { startServer } from '../stream-statics.js'
4+
import * as cfg from '../configuration.js'
5+
import * as types from '../types'
6+
import * as http from 'http'
7+
import * as https from 'https'
8+
import * as http2 from 'http2'
9+
10+
describe('Serving http', async () => {
11+
12+
it('should bring up an http server', async (t) => {
13+
t.mock.method(http, 'createServer')
14+
15+
await startServer({protocol: 'http'})
16+
17+
assert.strictEqual(http.createServer.mock.callCount(), 1);
18+
})
19+
})

Diff for: ‎src/__tests__/test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
import('./configuration.test.js')
2+
import('./stream-statics.test.js')

0 commit comments

Comments
 (0)
Please sign in to comment.