summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
Diffstat (limited to 'std/node')
-rw-r--r--std/node/os.ts6
-rw-r--r--std/node/os_test.ts14
2 files changed, 10 insertions, 10 deletions
diff --git a/std/node/os.ts b/std/node/os.ts
index 3bff03a69..8facde292 100644
--- a/std/node/os.ts
+++ b/std/node/os.ts
@@ -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";
@@ -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 */
diff --git a/std/node/os_test.ts b/std/node/os_test.ts
index 14d4e42ab..f13589a4b 100644
--- a/std/node/os_test.ts
+++ b/std/node/os_test.ts
@@ -29,6 +29,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() {
assertThrows(
@@ -217,13 +224,6 @@ test({
);
assertThrows(
() => {
- os.platform();
- },
- Error,
- "Not implemented"
- );
- assertThrows(
- () => {
os.release();
},
Error,