Skip to content

Commit

Permalink
Remove Deno.dir and dirs dependency (denoland/deno#6385)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry authored and caspervonb committed Jan 31, 2021
1 parent d2a2030 commit f16f8c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions node/os.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ export function getPriority(pid = 0): number {

/** Returns the string path of the current user's home directory. */
export function homedir(): string | null {
return Deno.dir("home");
notImplemented(SEE_GITHUB_ISSUE);
}

/** Returns the host name of the operating system as a string. */
export function hostname(): string {
return Deno.hostname();
notImplemented(SEE_GITHUB_ISSUE);
}

/** Returns an array containing the 1, 5, and 15 minute load averages */
Expand Down Expand Up @@ -182,7 +182,7 @@ export function setPriority(pid: number, priority?: number): void {

/** Returns the operating system's default directory for temporary files as a string. */
export function tmpdir(): string | null {
return Deno.dir("tmp");
notImplemented(SEE_GITHUB_ISSUE);
}

/** Not yet implemented */
Expand Down
5 changes: 3 additions & 2 deletions node/os_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ Deno.test({

Deno.test({
name: "home directory is a string",
ignore: true,
fn() {
assertEquals(typeof os.homedir(), "string");
},
});

Deno.test({
name: "tmp directory is a string",
ignore: true,
fn() {
assertEquals(typeof os.tmpdir(), "string");
},
});

Deno.test({
name: "hostname is a string",
ignore: true,
fn() {
assertEquals(typeof os.hostname(), "string");
},
Expand Down Expand Up @@ -192,8 +195,6 @@ Deno.test({
fn() {
assertEquals(`${os.arch}`, os.arch());
assertEquals(`${os.endianness}`, os.endianness());
assertEquals(`${os.homedir}`, os.homedir());
assertEquals(`${os.hostname}`, os.hostname());
assertEquals(`${os.platform}`, os.platform());
},
});
Expand Down

0 comments on commit f16f8c7

Please sign in to comment.