mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
parent
5319b85f14
commit
dda6328745
2 changed files with 14 additions and 0 deletions
|
@ -430,6 +430,14 @@ Process.prototype.config = {
|
|||
},
|
||||
};
|
||||
|
||||
Process.prototype.cpuUsage = function () {
|
||||
warnNotImplemented("process.cpuUsage()");
|
||||
return {
|
||||
user: 0,
|
||||
system: 0,
|
||||
};
|
||||
};
|
||||
|
||||
/** https://nodejs.org/api/process.html#process_process_cwd */
|
||||
Process.prototype.cwd = cwd;
|
||||
|
||||
|
|
|
@ -1131,3 +1131,9 @@ Deno.test(function importedExecArgvTest() {
|
|||
Deno.test(function importedExecPathTest() {
|
||||
assertEquals(importedExecPath, Deno.execPath());
|
||||
});
|
||||
|
||||
Deno.test("process.cpuUsage()", () => {
|
||||
const cpuUsage = process.cpuUsage();
|
||||
assert(typeof cpuUsage.user === "number");
|
||||
assert(typeof cpuUsage.system === "number");
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue