Skip to content

Commit b76a2c1

Browse files
committed
Auto-generated commit
1 parent d6f2ce3 commit b76a2c1

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-08-14)
7+
## Unreleased (2025-08-15)
88

99
<section class="commits">
1010

1111
### Commits
1212

1313
<details>
1414

15+
- [`1c9a2da`](https://github.com/stdlib-js/stdlib/commit/1c9a2dad4c7ff11aefab03110d9c0fa7ad94e969) - **docs:** update copy _(by Athan Reines)_
16+
- [`07f7c05`](https://github.com/stdlib-js/stdlib/commit/07f7c0522c73e6ad9505e1d45035ae439344200d) - **test:** use standardized assertion messages and fix lint errors _(by Philipp Burckhardt)_
17+
- [`f344466`](https://github.com/stdlib-js/stdlib/commit/f344466c6dcfb8f52d7f3148acaadd52772938da) - **test:** use .strictEqual() instead of .equal() and fix lint errors _(by Philipp Burckhardt)_
1518
- [`7748b7c`](https://github.com/stdlib-js/stdlib/commit/7748b7c758b477c52c94e5a69dcd2388377717ff) - **docs:** add comment _(by Athan Reines)_
1619
- [`74bef69`](https://github.com/stdlib-js/stdlib/commit/74bef694304a866f24b4b21a6c2e5f3c1e248859) - **refactor:** consolidate workaround logic in a function _(by Athan Reines)_
1720
- [`10d8600`](https://github.com/stdlib-js/stdlib/commit/10d86001daa3b4dbd6f3511f186186c95a8bcfea) - **refactor:** move functions to parent scope _(by Athan Reines)_

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,20 @@ var opts = {
7070
httpServer( opts );
7171
```
7272

73+
The function supports the following parameters:
74+
75+
- **options**: function options.
76+
- **clbk**: callback to invoke upon creating a server (_optional_).
77+
7378
The function accepts the following options:
7479

75-
- **html**: `buffer` or `string` to serve as HTML content.
76-
- **javascript**: `buffer` or `string` to serve as JavaScript.
80+
- **html**: Buffer or string to serve as HTML content.
81+
- **javascript**: Buffer or string to serve as JavaScript.
7782
- **port**: server port. Default: `0` (i.e., randomly assigned).
7883
- **maxport**: max server port (used when port hunting). Default: `=port`.
7984
- **hostname**: server hostname.
8085
- **address**: server address. Default: `"0.0.0.0"`.
81-
- **open**: `boolean` indicating whether to launch a web browser. Default: `false`.
86+
- **open**: boolean indicating whether to launch a web browser. Default: `false`.
8287

8388
To serve HTML content, set the `html` option. Once the content is requested, the server will close.
8489

@@ -150,7 +155,7 @@ httpServer( opts, onReady );
150155

151156
## Notes
152157

153-
- If neither the `html` or `javascript` option is set, the server serves an HTML boilerplate and then closes.
158+
- If neither the `html` nor `javascript` option is set, the server serves an HTML boilerplate and then closes.
154159

155160
</section>
156161

test/test.main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ tape( 'if only provided HTML, the server serves the HTML content once and then c
145145
if ( error ) {
146146
t.ok( false, error.message );
147147
}
148-
t.equal( body, opts.html, 'returns content' );
148+
t.strictEqual( body, opts.html, 'returns content' );
149149
if ( flg ) {
150150
t.end();
151151
} else {
@@ -207,7 +207,7 @@ tape( 'if only provided JavaScript, the server serves an HTML boilerplate and th
207207
t.ok( false, error.message );
208208
return t.end();
209209
}
210-
t.equal( data, html, 'returns HTML boilerplate' );
210+
t.strictEqual( data, html, 'returns HTML boilerplate' );
211211
getJavaScript();
212212
}
213213

@@ -227,7 +227,7 @@ tape( 'if only provided JavaScript, the server serves an HTML boilerplate and th
227227
t.ok( false, error.message );
228228
return t.end();
229229
}
230-
t.equal( data, opts.javascript, 'returns JavaScript' );
230+
t.strictEqual( data, opts.javascript, 'returns JavaScript' );
231231
if ( flg ) {
232232
t.end();
233233
} else {
@@ -285,7 +285,7 @@ tape( 'if provided HTML and JavaScript, the server serves the HTML and then the
285285
t.ok( false, error.message );
286286
return t.end();
287287
}
288-
t.equal( data, opts.html, 'returns HTML' );
288+
t.strictEqual( data, opts.html, 'returns HTML' );
289289
getJavaScript();
290290
}
291291

@@ -305,7 +305,7 @@ tape( 'if provided HTML and JavaScript, the server serves the HTML and then the
305305
t.ok( false, error.message );
306306
return t.end();
307307
}
308-
t.equal( data, opts.javascript, 'returns JavaScript' );
308+
t.strictEqual( data, opts.javascript, 'returns JavaScript' );
309309
if ( flg ) {
310310
t.end();
311311
} else {
@@ -362,7 +362,7 @@ tape( 'if a client only requests JavaScript, the server serves the JavaScript an
362362
t.ok( false, error.message );
363363
return t.end();
364364
}
365-
t.equal( data, opts.javascript, 'returns JavaScript' );
365+
t.strictEqual( data, opts.javascript, 'returns JavaScript' );
366366
if ( flg ) {
367367
t.end();
368368
} else {
@@ -415,7 +415,7 @@ tape( 'if the server receives a request for something other than the JavaScript
415415
if ( error ) {
416416
t.ok( false, error.message );
417417
}
418-
t.equal( res.statusCode, 404, 'returns 404' );
418+
t.strictEqual( res.statusCode, 404, 'returns 404' );
419419
server.close();
420420
}
421421

@@ -470,7 +470,7 @@ tape( 'if the server receives a request while closing, the server returns a `503
470470
t.ok( false, error.message );
471471
return t.end();
472472
}
473-
t.equal( data, opts.html, 'returns HTML' );
473+
t.strictEqual( data, opts.html, 'returns HTML' );
474474
next();
475475
}
476476

@@ -490,7 +490,7 @@ tape( 'if the server receives a request while closing, the server returns a `503
490490
t.ok( false, error.message );
491491
return t.end();
492492
}
493-
t.equal( res.statusCode, 503, 'returns 503 response' );
493+
t.strictEqual( res.statusCode, 503, 'returns 503 response' );
494494

495495
// Restore the close method:
496496
server.close = close;
@@ -540,7 +540,7 @@ tape( 'the function accepts `Buffer` objects for both HTML and JavaScript', func
540540
t.ok( false, error.message );
541541
return t.end();
542542
}
543-
t.equal( data, opts.html.toString(), 'returns HTML' );
543+
t.strictEqual( data, opts.html.toString(), 'returns HTML' );
544544
getJavaScript();
545545
}
546546

@@ -560,7 +560,7 @@ tape( 'the function accepts `Buffer` objects for both HTML and JavaScript', func
560560
t.ok( false, error.message );
561561
return t.end();
562562
}
563-
t.equal( data, opts.javascript.toString(), 'returns JavaScript' );
563+
t.strictEqual( data, opts.javascript.toString(), 'returns JavaScript' );
564564
if ( flg ) {
565565
t.end();
566566
} else {
@@ -663,7 +663,7 @@ tape( 'if the `open` option is `true`, the function will attempt to open the con
663663
function openURL( url ) {
664664
var options;
665665

666-
t.equal( url, 'http://'+opts.address+':'+opts.port, 'attempts to open URL' );
666+
t.strictEqual( url, 'http://'+opts.address+':'+opts.port, 'attempts to open URL' );
667667

668668
options = {
669669
'protocol': 'http:',
@@ -692,7 +692,7 @@ tape( 'if the `open` option is `true`, the function will attempt to open the con
692692
if ( error ) {
693693
t.ok( false, error.message );
694694
}
695-
t.equal( body, opts.html, 'returns content' );
695+
t.strictEqual( body, opts.html, 'returns content' );
696696
if ( flg ) {
697697
t.end();
698698
} else {

test/test.validate.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tape( 'the function returns a type error if not provided an options object', fun
5050

5151
for ( i = 0; i < values.length; i++ ) {
5252
err = validate( {}, values[i] );
53-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
53+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
5454
}
5555
t.end();
5656
});
@@ -75,7 +75,7 @@ tape( 'the function returns a type error if provided an `html` option which is n
7575
err = validate( {}, {
7676
'html': values[i]
7777
});
78-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
78+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
7979
}
8080
t.end();
8181
});
@@ -100,7 +100,7 @@ tape( 'the function returns a type error if provided a `javascript` option which
100100
err = validate( {}, {
101101
'javascript': values[i]
102102
});
103-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
103+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
104104
}
105105
t.end();
106106
});
@@ -125,7 +125,7 @@ tape( 'the function returns a type error if provided an `open` option which is n
125125
err = validate( {}, {
126126
'open': values[i]
127127
});
128-
t.equal( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
128+
t.strictEqual( err instanceof TypeError, true, 'returns a TypeError when provided '+values[i] );
129129
}
130130
t.end();
131131
});
@@ -151,7 +151,7 @@ tape( 'the function returns `null` if all options are valid', function test( t )
151151

152152
err = validate( opts, options );
153153

154-
t.equal( err, null, 'returns null' );
154+
t.strictEqual( err, null, 'returns expected value' );
155155
t.deepEqual( opts, expected, 'extracts options' );
156156

157157
t.end();
@@ -172,7 +172,7 @@ tape( 'the function ignores unrecognized options', function test( t ) {
172172

173173
err = validate( opts, options );
174174

175-
t.equal( err, null, 'returns null' );
175+
t.strictEqual( err, null, 'returns expected value' );
176176
t.deepEqual( opts, {}, 'ignores unrecognized options' );
177177

178178
t.end();

0 commit comments

Comments
 (0)