mirror of
https://github.com/denoland/deno.git
synced 2025-03-04 01:44:26 -05:00
feat(std/node) : add os.platform (#4064)
This commit is contained in:
parent
08686cbc3a
commit
754b8c65ad
2 changed files with 10 additions and 10 deletions
|
@ -21,6 +21,7 @@
|
||||||
import { notImplemented } from "./_utils.ts";
|
import { notImplemented } from "./_utils.ts";
|
||||||
import { validateIntegerRange } from "./util.ts";
|
import { validateIntegerRange } from "./util.ts";
|
||||||
import { EOL as fsEOL } from "../fs/eol.ts";
|
import { EOL as fsEOL } from "../fs/eol.ts";
|
||||||
|
import { process } from "./process.ts";
|
||||||
|
|
||||||
const SEE_GITHUB_ISSUE = "See https://github.com/denoland/deno/issues/3802";
|
const SEE_GITHUB_ISSUE = "See https://github.com/denoland/deno/issues/3802";
|
||||||
|
|
||||||
|
@ -144,10 +145,9 @@ export function loadavg(): number[] {
|
||||||
export function networkInterfaces(): NetworkInterfaces {
|
export function networkInterfaces(): NetworkInterfaces {
|
||||||
notImplemented(SEE_GITHUB_ISSUE);
|
notImplemented(SEE_GITHUB_ISSUE);
|
||||||
}
|
}
|
||||||
|
/** Returns the a string identifying the operating system platform. The value is set at compile time. Possible values are 'darwin', 'linux', and 'win32'. */
|
||||||
/** Not yet implemented */
|
|
||||||
export function platform(): string {
|
export function platform(): string {
|
||||||
notImplemented(SEE_GITHUB_ISSUE);
|
return process.platform;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Not yet implemented */
|
/** Not yet implemented */
|
||||||
|
|
|
@ -28,6 +28,13 @@ test({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test({
|
||||||
|
name: "platform is a string",
|
||||||
|
fn() {
|
||||||
|
assertEquals(typeof os.platform(), "string");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test({
|
test({
|
||||||
name: "getPriority(): PID must be a 32 bit integer",
|
name: "getPriority(): PID must be a 32 bit integer",
|
||||||
fn() {
|
fn() {
|
||||||
|
@ -215,13 +222,6 @@ test({
|
||||||
Error,
|
Error,
|
||||||
"Not implemented"
|
"Not implemented"
|
||||||
);
|
);
|
||||||
assertThrows(
|
|
||||||
() => {
|
|
||||||
os.platform();
|
|
||||||
},
|
|
||||||
Error,
|
|
||||||
"Not implemented"
|
|
||||||
);
|
|
||||||
assertThrows(
|
assertThrows(
|
||||||
() => {
|
() => {
|
||||||
os.release();
|
os.release();
|
||||||
|
|
Loading…
Add table
Reference in a new issue