Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre authored and astrobot-houston committed Mar 1, 2024
1 parent b47dcaa commit df05138
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/integrations/node/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
28 changes: 14 additions & 14 deletions packages/integrations/node/test/server-host.test.js
Original file line number Diff line number Diff line change
@@ -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);
});
});

0 comments on commit df05138

Please sign in to comment.