mirror of
https://github.com/denoland/deno.git
synced 2025-01-16 10:54:14 -05:00
fix: replace Deno.platform usages (denoland/deno_std#590)
Original: 0e6f163ac6
This commit is contained in:
parent
d7f3e28eed
commit
7b22dec0fa
5 changed files with 6 additions and 6 deletions
|
@ -16,7 +16,7 @@ import { ensureSymlink, ensureSymlinkSync } from "./ensure_symlink.ts";
|
||||||
const testdataDir = path.resolve("fs", "testdata");
|
const testdataDir = path.resolve("fs", "testdata");
|
||||||
|
|
||||||
// TODO(axetroy): Add test for Windows once symlink is implemented for Windows.
|
// TODO(axetroy): Add test for Windows once symlink is implemented for Windows.
|
||||||
const isWindows = Deno.platform.os === "win";
|
const isWindows = Deno.build.os === "win";
|
||||||
|
|
||||||
async function testCopy(
|
async function testCopy(
|
||||||
name: string,
|
name: string,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { ensureSymlink, ensureSymlinkSync } from "./ensure_symlink.ts";
|
||||||
import * as path from "./path/mod.ts";
|
import * as path from "./path/mod.ts";
|
||||||
|
|
||||||
const testdataDir = path.resolve("fs", "testdata");
|
const testdataDir = path.resolve("fs", "testdata");
|
||||||
const isWindows = Deno.platform.os === "win";
|
const isWindows = Deno.build.os === "win";
|
||||||
|
|
||||||
test(async function ensureSymlinkIfItNotExist(): Promise<void> {
|
test(async function ensureSymlinkIfItNotExist(): Promise<void> {
|
||||||
const testDir = path.join(testdataDir, "link_file_1");
|
const testDir = path.join(testdataDir, "link_file_1");
|
||||||
|
|
|
@ -61,9 +61,9 @@ test(async function serveDirectory(): Promise<void> {
|
||||||
// `Deno.FileInfo` is not completely compatible with Windows yet
|
// `Deno.FileInfo` is not completely compatible with Windows yet
|
||||||
// TODO: `mode` should work correctly in the future.
|
// TODO: `mode` should work correctly in the future.
|
||||||
// Correct this test case accordingly.
|
// Correct this test case accordingly.
|
||||||
Deno.platform.os !== "win" &&
|
Deno.build.os !== "win" &&
|
||||||
assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page));
|
assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page));
|
||||||
Deno.platform.os === "win" &&
|
Deno.build.os === "win" &&
|
||||||
assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page));
|
assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page));
|
||||||
assert(
|
assert(
|
||||||
page.includes(
|
page.includes(
|
||||||
|
|
|
@ -10,7 +10,7 @@ const encoder = new TextEncoder();
|
||||||
const decoder = new TextDecoder("utf-8");
|
const decoder = new TextDecoder("utf-8");
|
||||||
// Regular expression to test disk driver letter. eg "C:\\User\username\path\to"
|
// Regular expression to test disk driver letter. eg "C:\\User\username\path\to"
|
||||||
const driverLetterReg = /^[c-z]:/i;
|
const driverLetterReg = /^[c-z]:/i;
|
||||||
const isWindows = Deno.platform.os === "win";
|
const isWindows = Deno.build.os === "win";
|
||||||
|
|
||||||
function showHelp(): void {
|
function showHelp(): void {
|
||||||
console.log(`deno installer
|
console.log(`deno installer
|
||||||
|
|
|
@ -10,7 +10,7 @@ import * as fs from "../fs/mod.ts";
|
||||||
import { install, isRemoteUrl } from "./mod.ts";
|
import { install, isRemoteUrl } from "./mod.ts";
|
||||||
|
|
||||||
let fileServer: Deno.Process;
|
let fileServer: Deno.Process;
|
||||||
const isWindows = Deno.platform.os === "win";
|
const isWindows = Deno.build.os === "win";
|
||||||
|
|
||||||
// copied from `http/file_server_test.ts`
|
// copied from `http/file_server_test.ts`
|
||||||
async function startFileServer(): Promise<void> {
|
async function startFileServer(): Promise<void> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue