/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/unit/network_interfaces_test.ts
30 строк
879 B
Kenta Moriuchi
chore: Happy New Year 2026 (#31748)
08 янв 2026, 18:28
Не верифицирован
08 янв 2026, 18:28
8193cf9
Код
Авторство
О чём код?
// Copyright 2018-2026 the Deno authors. MIT license. import { assert } from "./test_util.ts"; Deno.test( { name: "Deno.networkInterfaces", permissions: { sys: ["networkInterfaces"] }, }, () => { const networkInterfaces = Deno.networkInterfaces(); assert(Array.isArray(networkInterfaces)); assert(networkInterfaces.length > 0); for ( const { name, family, address, netmask, scopeid, cidr, mac } of networkInterfaces ) { assert(typeof name === "string"); assert(family === "IPv4" || family === "IPv6"); assert(typeof address === "string"); assert(typeof netmask === "string"); assert( (family === "IPv6" && typeof scopeid === "number") || (family === "IPv4" && scopeid === null), ); assert(typeof cidr === "string"); assert(typeof mac === "string"); } }, );