mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -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';
|
import type { Options } from './types.js';
|
||||||
|
|
||||||
// Used to get Host Value at Runtime
|
// 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') {
|
if (typeof host === 'boolean') {
|
||||||
return host ? '0.0.0.0' : 'localhost';
|
return host ? '0.0.0.0' : 'localhost';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { describe, it } from 'node:test';
|
|
||||||
import * as assert from 'node:assert/strict';
|
import * as assert from 'node:assert/strict';
|
||||||
|
import { describe, it } from 'node:test';
|
||||||
import { hostOptions } from '../dist/standalone.js';
|
import { hostOptions } from '../dist/standalone.js';
|
||||||
|
|
||||||
describe('host', () => {
|
describe('host', () => {
|
||||||
|
@ -14,7 +14,7 @@ describe('host', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the value of host when host is a string', () => {
|
it('returns the value of host when host is a string', () => {
|
||||||
const host = "1.1.1.1"
|
const host = '1.1.1.1';
|
||||||
const options = { host };
|
const options = { host };
|
||||||
assert.equal(hostOptions(options.host), host);
|
assert.equal(hostOptions(options.host), host);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue