0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

[ci] format

This commit is contained in:
Satanshu Mishra 2024-03-01 08:33:27 +00:00 committed by astrobot-houston
parent b47dcaa259
commit df05138ebe
2 changed files with 15 additions and 15 deletions

View file

@ -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';
}

View file

@ -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);
});
});