mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
[ci] format
This commit is contained in:
parent
b47dcaa259
commit
df05138ebe
2 changed files with 15 additions and 15 deletions
|
@ -10,7 +10,7 @@ import { createStaticHandler } from './serve-static.js';
|
|||
import type { Options } from './types.js';
|
||||
|
||||
// Used to get Host Value at Runtime
|
||||
export const hostOptions = (host: Options["host"]): string => {
|
||||
export const hostOptions = (host: Options['host']): string => {
|
||||
if (typeof host === 'boolean') {
|
||||
return host ? '0.0.0.0' : 'localhost';
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import { describe, it } from 'node:test';
|
||||
import * as assert from 'node:assert/strict';
|
||||
import { describe, it } from 'node:test';
|
||||
import { hostOptions } from '../dist/standalone.js';
|
||||
|
||||
describe('host', () => {
|
||||
it('returns "0.0.0.0" when host is true', () => {
|
||||
const options = { host: true };
|
||||
assert.equal(hostOptions(options.host), '0.0.0.0');
|
||||
});
|
||||
it('returns "0.0.0.0" when host is true', () => {
|
||||
const options = { host: true };
|
||||
assert.equal(hostOptions(options.host), '0.0.0.0');
|
||||
});
|
||||
|
||||
it('returns "localhost" when host is false', () => {
|
||||
const options = { host: false };
|
||||
assert.equal(hostOptions(options.host), 'localhost');
|
||||
});
|
||||
it('returns "localhost" when host is false', () => {
|
||||
const options = { host: false };
|
||||
assert.equal(hostOptions(options.host), 'localhost');
|
||||
});
|
||||
|
||||
it('returns the value of host when host is a string', () => {
|
||||
const host = "1.1.1.1"
|
||||
const options = { host };
|
||||
assert.equal(hostOptions(options.host), host);
|
||||
});
|
||||
it('returns the value of host when host is a string', () => {
|
||||
const host = '1.1.1.1';
|
||||
const options = { host };
|
||||
assert.equal(hostOptions(options.host), host);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue