Skip to content

Commit

Permalink
feat(node) : add os.platform (denoland/deno#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecyrbe authored and caspervonb committed Jan 31, 2021
1 parent 1737861 commit 85f4710
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions node/os.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import { notImplemented } from "./_utils.ts";
import { validateIntegerRange } from "./util.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";

Expand Down Expand Up @@ -144,10 +145,9 @@ export function loadavg(): number[] {
export function networkInterfaces(): NetworkInterfaces {
notImplemented(SEE_GITHUB_ISSUE);
}

/** Not yet implemented */
/** Returns the a string identifying the operating system platform. The value is set at compile time. Possible values are 'darwin', 'linux', and 'win32'. */
export function platform(): string {
notImplemented(SEE_GITHUB_ISSUE);
return process.platform;
}

/** Not yet implemented */
Expand Down
14 changes: 7 additions & 7 deletions node/os_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ test({
}
});

test({
name: "platform is a string",
fn() {
assertEquals(typeof os.platform(), "string");
}
});

test({
name: "getPriority(): PID must be a 32 bit integer",
fn() {
Expand Down Expand Up @@ -215,13 +222,6 @@ test({
Error,
"Not implemented"
);
assertThrows(
() => {
os.platform();
},
Error,
"Not implemented"
);
assertThrows(
() => {
os.release();
Expand Down

0 comments on commit 85f4710

Please sign in to comment.