1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 16:49:18 -05:00

refactor: rename Deno.TestDefinition.skip to ignore (#4400)

This commit is contained in:
Bartek Iwańczuk 2020-03-19 10:58:12 +01:00 committed by GitHub
parent 54d1f299dc
commit b0b27c4310
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 82 additions and 83 deletions

View file

@ -17,7 +17,7 @@ declare namespace Deno {
export interface TestDefinition { export interface TestDefinition {
fn: TestFunction; fn: TestFunction;
name: string; name: string;
skip?: boolean; ignore?: boolean;
disableOpSanitizer?: boolean; disableOpSanitizer?: boolean;
disableResourceSanitizer?: boolean; disableResourceSanitizer?: boolean;
} }
@ -38,7 +38,7 @@ declare namespace Deno {
enum TestStatus { enum TestStatus {
Passed = "passed", Passed = "passed",
Failed = "failed", Failed = "failed",
Skipped = "skipped" Ignored = "ignored"
} }
interface TestResult { interface TestResult {

View file

@ -10,7 +10,7 @@ import { assert } from "./util.ts";
const RED_FAILED = red("FAILED"); const RED_FAILED = red("FAILED");
const GREEN_OK = green("ok"); const GREEN_OK = green("ok");
const YELLOW_SKIPPED = yellow("SKIPPED"); const YELLOW_IGNORED = yellow("ignored");
const disabledConsole = new Console((_x: string, _isErr?: boolean): void => {}); const disabledConsole = new Console((_x: string, _isErr?: boolean): void => {});
function formatDuration(time = 0): string { function formatDuration(time = 0): string {
@ -68,7 +68,7 @@ export type TestFunction = () => void | Promise<void>;
export interface TestDefinition { export interface TestDefinition {
fn: TestFunction; fn: TestFunction;
name: string; name: string;
skip?: boolean; ignore?: boolean;
disableOpSanitizer?: boolean; disableOpSanitizer?: boolean;
disableResourceSanitizer?: boolean; disableResourceSanitizer?: boolean;
} }
@ -93,12 +93,12 @@ export function test(
if (!t) { if (!t) {
throw new TypeError("The test name can't be empty"); throw new TypeError("The test name can't be empty");
} }
testDef = { fn: fn as TestFunction, name: t, skip: false }; testDef = { fn: fn as TestFunction, name: t, ignore: false };
} else if (typeof t === "function") { } else if (typeof t === "function") {
if (!t.name) { if (!t.name) {
throw new TypeError("The test function can't be anonymous"); throw new TypeError("The test function can't be anonymous");
} }
testDef = { fn: t, name: t.name, skip: false }; testDef = { fn: t, name: t.name, ignore: false };
} else { } else {
if (!t.fn) { if (!t.fn) {
throw new TypeError("Missing test function"); throw new TypeError("Missing test function");
@ -106,8 +106,7 @@ export function test(
if (!t.name) { if (!t.name) {
throw new TypeError("The test name can't be empty"); throw new TypeError("The test name can't be empty");
} }
testDef = { ...t, ignore: Boolean(t.ignore) };
testDef = { ...t, skip: Boolean(t.skip) };
} }
if (testDef.disableOpSanitizer !== true) { if (testDef.disableOpSanitizer !== true) {
@ -141,7 +140,7 @@ export interface RunTestsOptions {
enum TestStatus { enum TestStatus {
Passed = "passed", Passed = "passed",
Failed = "failed", Failed = "failed",
Skipped = "skipped" Ignored = "ignored"
} }
interface TestResult { interface TestResult {
@ -211,11 +210,11 @@ class TestApi {
const results: TestResult[] = []; const results: TestResult[] = [];
const suiteStart = +new Date(); const suiteStart = +new Date();
for (const { name, fn, skip } of this.testsToRun) { for (const { name, fn, ignore } of this.testsToRun) {
const result: Partial<TestResult> = { name, duration: 0 }; const result: Partial<TestResult> = { name, duration: 0 };
yield { kind: TestEvent.TestStart, name }; yield { kind: TestEvent.TestStart, name };
if (skip) { if (ignore) {
result.status = TestStatus.Skipped; result.status = TestStatus.Ignored;
this.stats.ignored++; this.stats.ignored++;
} else { } else {
const start = +new Date(); const start = +new Date();
@ -321,8 +320,8 @@ export class ConsoleTestReporter implements TestReporter {
case TestStatus.Failed: case TestStatus.Failed:
this.log(`${RED_FAILED} ${formatDuration(result.duration)}`); this.log(`${RED_FAILED} ${formatDuration(result.duration)}`);
break; break;
case TestStatus.Skipped: case TestStatus.Ignored:
this.log(`${YELLOW_SKIPPED} ${formatDuration(result.duration)}`); this.log(`${YELLOW_IGNORED} ${formatDuration(result.duration)}`);
break; break;
} }
} }

View file

@ -17,7 +17,7 @@ unitTest(function simpleTestFn(): void {
}); });
unitTest({ unitTest({
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { read: true, write: true }, perms: { read: true, write: true },
}, },
function complexTestFn(): void { function complexTestFn(): void {

View file

@ -27,7 +27,7 @@ unitTest(
// Check symlink when not on windows // Check symlink when not on windows
unitTest( unitTest(
{ {
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { read: true, write: true } perms: { read: true, write: true }
}, },
function chmodSyncSymlinkSuccess(): void { function chmodSyncSymlinkSuccess(): void {
@ -103,7 +103,7 @@ unitTest(
unitTest( unitTest(
{ {
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { read: true, write: true } perms: { read: true, write: true }
}, },
async function chmodSymlinkSuccess(): Promise<void> { async function chmodSymlinkSuccess(): Promise<void> {

View file

@ -203,7 +203,7 @@ unitTest(
{ {
// FIXME(bartlomieju): // FIXME(bartlomieju):
// The feature below is not implemented, but the test should work after implementation // The feature below is not implemented, but the test should work after implementation
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function fetchWithInfRedirection(): Promise<void> { async function fetchWithInfRedirection(): Promise<void> {
@ -363,7 +363,7 @@ function bufferServer(addr: string): Deno.Buffer {
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function fetchRequest(): Promise<void> { async function fetchRequest(): Promise<void> {
@ -393,7 +393,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function fetchPostBodyString(): Promise<void> { async function fetchPostBodyString(): Promise<void> {
@ -427,7 +427,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function fetchPostBodyTypedArray(): Promise<void> { async function fetchPostBodyTypedArray(): Promise<void> {

View file

@ -18,7 +18,7 @@ unitTest(
{ {
perms: { net: true }, perms: { net: true },
// TODO: // TODO:
skip: Deno.build.os === "win" ignore: Deno.build.os === "win"
}, },
function netUdpListenClose(): void { function netUdpListenClose(): void {
const socket = Deno.listen({ const socket = Deno.listen({
@ -111,7 +111,7 @@ unitTest({ perms: { net: true } }, async function netTcpDialListen(): Promise<
}); });
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { net: true } }, { ignore: Deno.build.os === "win", perms: { net: true } },
async function netUdpSendReceive(): Promise<void> { async function netUdpSendReceive(): Promise<void> {
const alice = Deno.listen({ port: 4500, transport: "udp" }); const alice = Deno.listen({ port: 4500, transport: "udp" });
assertEquals(alice.addr.port, 4500); assertEquals(alice.addr.port, 4500);
@ -151,7 +151,7 @@ unitTest(
); );
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { net: true } }, { ignore: Deno.build.os === "win", perms: { net: true } },
async function netUdpListenCloseWhileIterating(): Promise<void> { async function netUdpListenCloseWhileIterating(): Promise<void> {
const socket = Deno.listen({ port: 8000, transport: "udp" }); const socket = Deno.listen({ port: 8000, transport: "udp" });
const nextWhileClosing = socket[Symbol.asyncIterator]().next(); const nextWhileClosing = socket[Symbol.asyncIterator]().next();
@ -166,7 +166,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function netListenAsyncIterator(): Promise<void> { async function netListenAsyncIterator(): Promise<void> {
@ -201,7 +201,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function netCloseReadSuccess() { async function netCloseReadSuccess() {
@ -238,7 +238,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function netDoubleCloseRead() { async function netDoubleCloseRead() {
@ -270,7 +270,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function netCloseWriteSuccess() { async function netCloseWriteSuccess() {
@ -309,7 +309,7 @@ unitTest(
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true, ignore: true,
perms: { net: true } perms: { net: true }
}, },
async function netDoubleCloseWrite() { async function netDoubleCloseWrite() {

View file

@ -50,7 +50,7 @@ unitTest(function envPermissionDenied2(): void {
// case-insensitive. Case normalization needs be done using the collation // case-insensitive. Case normalization needs be done using the collation
// that Windows uses, rather than naively using String.toLowerCase(). // that Windows uses, rather than naively using String.toLowerCase().
unitTest( unitTest(
{ skip: Deno.build.os !== "win", perms: { env: true, run: true } }, { ignore: Deno.build.os !== "win", perms: { env: true, run: true } },
async function envCaseInsensitive() { async function envCaseInsensitive() {
// Utility function that runs a Deno subprocess with the environment // Utility function that runs a Deno subprocess with the environment
// specified in `inputEnv`. The subprocess reads the environment variables // specified in `inputEnv`. The subprocess reads the environment variables

View file

@ -49,7 +49,7 @@ unitTest(
unitTest( unitTest(
{ {
// No signals on windows. // No signals on windows.
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { run: true } perms: { run: true }
}, },
async function runCommandFailedWithSignal(): Promise<void> { async function runCommandFailedWithSignal(): Promise<void> {

View file

@ -14,7 +14,7 @@ unitTest({ perms: { read: true } }, function realpathSyncSuccess(): void {
unitTest( unitTest(
{ {
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { read: true, write: true } perms: { read: true, write: true }
}, },
function realpathSyncSymlink(): void { function realpathSyncSymlink(): void {
@ -66,7 +66,7 @@ unitTest({ perms: { read: true } }, async function realpathSuccess(): Promise<
unitTest( unitTest(
{ {
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
perms: { read: true, write: true } perms: { read: true, write: true }
}, },
async function realpathSymlink(): Promise<void> { async function realpathSymlink(): Promise<void> {

View file

@ -14,7 +14,7 @@ function defer(n: number): Promise<void> {
} }
unitTest( unitTest(
{ skip: Deno.build.os !== "win" }, { ignore: Deno.build.os !== "win" },
async function signalsNotImplemented(): Promise<void> { async function signalsNotImplemented(): Promise<void> {
assertThrows( assertThrows(
() => { () => {
@ -104,7 +104,7 @@ unitTest(
); );
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { run: true, net: true } }, { ignore: Deno.build.os === "win", perms: { run: true, net: true } },
async function signalStreamTest(): Promise<void> { async function signalStreamTest(): Promise<void> {
const resolvable = createResolvable(); const resolvable = createResolvable();
// This prevents the program from exiting. // This prevents the program from exiting.
@ -138,7 +138,7 @@ unitTest(
); );
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { run: true } }, { ignore: Deno.build.os === "win", perms: { run: true } },
async function signalPromiseTest(): Promise<void> { async function signalPromiseTest(): Promise<void> {
const resolvable = createResolvable(); const resolvable = createResolvable();
// This prevents the program from exiting. // This prevents the program from exiting.
@ -161,7 +161,7 @@ unitTest(
); );
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { run: true } }, { ignore: Deno.build.os === "win", perms: { run: true } },
async function signalShorthandsTest(): Promise<void> { async function signalShorthandsTest(): Promise<void> {
let s: Deno.SignalStream; let s: Deno.SignalStream;
s = Deno.signals.alarm(); // for SIGALRM s = Deno.signals.alarm(); // for SIGALRM

View file

@ -184,7 +184,7 @@ unitTest({ perms: { read: true } }, async function lstatNotFound(): Promise<
}); });
unitTest( unitTest(
{ skip: Deno.build.os !== "win", perms: { read: true, write: true } }, { ignore: Deno.build.os !== "win", perms: { read: true, write: true } },
async function statNoUnixFields(): Promise<void> { async function statNoUnixFields(): Promise<void> {
const enc = new TextEncoder(); const enc = new TextEncoder();
const data = enc.encode("Hello"); const data = enc.encode("Hello");
@ -205,7 +205,7 @@ unitTest(
); );
unitTest( unitTest(
{ skip: Deno.build.os === "win", perms: { read: true, write: true } }, { ignore: Deno.build.os === "win", perms: { read: true, write: true } },
async function statUnixFields(): Promise<void> { async function statUnixFields(): Promise<void> {
const enc = new TextEncoder(); const enc = new TextEncoder();
const data = enc.encode("Hello"); const data = enc.encode("Hello");

View file

@ -123,12 +123,12 @@ interface UnitTestPermissions {
} }
interface UnitTestOptions { interface UnitTestOptions {
skip?: boolean; ignore?: boolean;
perms?: UnitTestPermissions; perms?: UnitTestPermissions;
} }
interface UnitTestDefinition extends Deno.TestDefinition { interface UnitTestDefinition extends Deno.TestDefinition {
skip: boolean; ignore: boolean;
perms: Permissions; perms: Permissions;
} }
@ -169,7 +169,7 @@ export function unitTest(
const unitTestDefinition: UnitTestDefinition = { const unitTestDefinition: UnitTestDefinition = {
name, name,
fn, fn,
skip: !!options.skip, ignore: !!options.ignore,
perms: normalizedPerms perms: normalizedPerms
}; };

View file

@ -3,7 +3,7 @@ import { unitTest, assertEquals } from "./test_util.ts";
unitTest( unitTest(
{ {
skip: Deno.build.os === "win" ignore: Deno.build.os === "win"
}, },
function umaskSuccess(): void { function umaskSuccess(): void {
const prevMask = Deno.umask(0o020); const prevMask = Deno.umask(0o020);

View file

@ -183,7 +183,7 @@ unitTest(function sortingNonExistentParamRemovesQuestionMarkFromURL(): void {
unitTest( unitTest(
{ {
// FIXME(bartlomieju) // FIXME(bartlomieju)
skip: true ignore: true
}, },
function customInspectFunction(): void { function customInspectFunction(): void {
const url = new URL("http://example.com/?"); const url = new URL("http://example.com/?");

View file

@ -43,7 +43,7 @@ zzz,yyy,xxx`,
["a,a", `bbb`, "ccc"], ["a,a", `bbb`, "ccc"],
["zzz", "yyy", "xxx"] ["zzz", "yyy", "xxx"]
], ],
skip: true ignore: true
}, },
{ {
Name: "NoEOLTest", Name: "NoEOLTest",
@ -63,7 +63,7 @@ line","one line","three
line line
field"`, field"`,
Output: [["two\nline"], ["one line"], ["three\nline\nfield"]], Output: [["two\nline"], ["one line"], ["three\nline\nfield"]],
skip: true ignore: true
}, },
{ {
Name: "BlankLine", Name: "BlankLine",
@ -263,20 +263,20 @@ x,,,
Input: 'a,"b\nc"d,e', Input: 'a,"b\nc"d,e',
Error: true, Error: true,
// Error: &ParseError{StartLine: 1, Line: 2, Column: 1, Err: ErrQuote}, // Error: &ParseError{StartLine: 1, Line: 2, Column: 1, Err: ErrQuote},
skip: true ignore: true
}, },
{ {
Name: "StartLine2", Name: "StartLine2",
Input: 'a,b\n"d\n\n,e', Input: 'a,b\n"d\n\n,e',
Error: true, Error: true,
// Error: &ParseError{StartLine: 2, Line: 5, Column: 0, Err: ErrQuote}, // Error: &ParseError{StartLine: 2, Line: 5, Column: 0, Err: ErrQuote},
skip: true ignore: true
}, },
{ {
Name: "CRLFInQuotedField", // Issue 21201 Name: "CRLFInQuotedField", // Issue 21201
Input: 'A,"Hello\r\nHi",B\r\n', Input: 'A,"Hello\r\nHi",B\r\n',
Output: [["A", "Hello\nHi", "B"]], Output: [["A", "Hello\nHi", "B"]],
skip: true ignore: true
}, },
{ {
Name: "BinaryBlobField", // Issue 19410 Name: "BinaryBlobField", // Issue 19410
@ -287,32 +287,32 @@ x,,,
Name: "TrailingCR", Name: "TrailingCR",
Input: "field1,field2\r", Input: "field1,field2\r",
Output: [["field1", "field2"]], Output: [["field1", "field2"]],
skip: true ignore: true
}, },
{ {
Name: "QuotedTrailingCR", Name: "QuotedTrailingCR",
Input: '"field"\r', Input: '"field"\r',
Output: [['"field"']], Output: [['"field"']],
skip: true ignore: true
}, },
{ {
Name: "QuotedTrailingCRCR", Name: "QuotedTrailingCRCR",
Input: '"field"\r\r', Input: '"field"\r\r',
Error: true, Error: true,
// Error: &ParseError{StartLine: 1, Line: 1, Column: 6, Err: ErrQuote}, // Error: &ParseError{StartLine: 1, Line: 1, Column: 6, Err: ErrQuote},
skip: true ignore: true
}, },
{ {
Name: "FieldCR", Name: "FieldCR",
Input: "field\rfield\r", Input: "field\rfield\r",
Output: [["field\rfield"]], Output: [["field\rfield"]],
skip: true ignore: true
}, },
{ {
Name: "FieldCRCR", Name: "FieldCRCR",
Input: "field\r\rfield\r\r", Input: "field\r\rfield\r\r",
Output: [["field\r\rfield\r"]], Output: [["field\r\rfield\r"]],
skip: true ignore: true
}, },
{ {
Name: "FieldCRCRLF", Name: "FieldCRCRLF",
@ -328,7 +328,7 @@ x,,,
Name: "FieldCRCRLFCRCR", Name: "FieldCRCRLFCRCR",
Input: "field\r\r\n\r\rfield\r\r\n\r\r", Input: "field\r\r\n\r\rfield\r\r\n\r\r",
Output: [["field\r"], ["\r\rfield\r"], ["\r"]], Output: [["field\r"], ["\r\rfield\r"], ["\r"]],
skip: true ignore: true
}, },
{ {
Name: "MultiFieldCRCRLFCRCR", Name: "MultiFieldCRCRLFCRCR",
@ -338,7 +338,7 @@ x,,,
["\r\rfield1", "field2\r"], ["\r\rfield1", "field2\r"],
["\r\r", ""] ["\r\r", ""]
], ],
skip: true ignore: true
}, },
{ {
Name: "NonASCIICommaAndComment", Name: "NonASCIICommaAndComment",
@ -374,12 +374,12 @@ x,,,
Name: "QuotedFieldMultipleLF", Name: "QuotedFieldMultipleLF",
Input: '"\n\n\n\n"', Input: '"\n\n\n\n"',
Output: [["\n\n\n\n"]], Output: [["\n\n\n\n"]],
skip: true ignore: true
}, },
{ {
Name: "MultipleCRLF", Name: "MultipleCRLF",
Input: "\r\n\r\n\r\n\r\n", Input: "\r\n\r\n\r\n\r\n",
skip: true ignore: true
}, },
/** /**
* The implementation may read each line in several chunks if * The implementation may read each line in several chunks if
@ -392,7 +392,7 @@ x,,,
"#ignore\n".repeat(10000) + "@".repeat(5000) + "," + "*".repeat(5000), "#ignore\n".repeat(10000) + "@".repeat(5000) + "," + "*".repeat(5000),
Output: [["@".repeat(5000), "*".repeat(5000)]], Output: [["@".repeat(5000), "*".repeat(5000)]],
Comment: "#", Comment: "#",
skip: true ignore: true
}, },
{ {
Name: "QuoteWithTrailingCRLF", Name: "QuoteWithTrailingCRLF",
@ -410,27 +410,27 @@ x,,,
Name: "DoubleQuoteWithTrailingCRLF", Name: "DoubleQuoteWithTrailingCRLF",
Input: '"foo""bar"\r\n', Input: '"foo""bar"\r\n',
Output: [[`foo"bar`]], Output: [[`foo"bar`]],
skip: true ignore: true
}, },
{ {
Name: "EvenQuotes", Name: "EvenQuotes",
Input: `""""""""`, Input: `""""""""`,
Output: [[`"""`]], Output: [[`"""`]],
skip: true ignore: true
}, },
{ {
Name: "OddQuotes", Name: "OddQuotes",
Input: `"""""""`, Input: `"""""""`,
Error: true, Error: true,
// Error:" &ParseError{StartLine: 1, Line: 1, Column: 7, Err: ErrQuote}", // Error:" &ParseError{StartLine: 1, Line: 1, Column: 7, Err: ErrQuote}",
skip: true ignore: true
}, },
{ {
Name: "LazyOddQuotes", Name: "LazyOddQuotes",
Input: `"""""""`, Input: `"""""""`,
Output: [[`"""`]], Output: [[`"""`]],
LazyQuotes: true, LazyQuotes: true,
skip: true ignore: true
}, },
{ {
Name: "BadComma1", Name: "BadComma1",
@ -466,7 +466,7 @@ x,,,
]; ];
for (const t of testCases) { for (const t of testCases) {
Deno.test({ Deno.test({
skip: !!t.skip, ignore: !!t.ignore,
name: `[CSV] ${t.Name}`, name: `[CSV] ${t.Name}`,
async fn(): Promise<void> { async fn(): Promise<void> {
let comma = ","; let comma = ",";

View file

@ -27,10 +27,10 @@ async function startServer(): Promise<Deno.Process> {
} }
// TODO: https://github.com/denoland/deno/issues/4108 // TODO: https://github.com/denoland/deno/issues/4108
const skip = build.os == "win"; const ignore = build.os == "win";
test({ test({
skip, ignore,
name: "GET / should serve html", name: "GET / should serve html",
async fn() { async fn() {
const server = await startServer(); const server = await startServer();
@ -49,7 +49,7 @@ test({
}); });
test({ test({
skip, ignore,
name: "GET /ws should upgrade conn to ws", name: "GET /ws should upgrade conn to ws",
async fn() { async fn() {
const server = await startServer(); const server = await startServer();

View file

@ -6,7 +6,7 @@ Deno.test({
name: "[examples/curl] send a request to a specified url", name: "[examples/curl] send a request to a specified url",
// FIXME(bartlomieju): this test is leaking both resources and ops, // FIXME(bartlomieju): this test is leaking both resources and ops,
// and causes interference with other tests // and causes interference with other tests
skip: true, ignore: true,
fn: async () => { fn: async () => {
const server = serve({ port: 8081 }); const server = serve({ port: 8081 });
(async (): Promise<void> => { (async (): Promise<void> => {

View file

@ -8,7 +8,7 @@ const isWindows = Deno.build.os == "win";
export async function testWalk( export async function testWalk(
setup: (arg0: string) => void | Promise<void>, setup: (arg0: string) => void | Promise<void>,
t: Deno.TestFunction, t: Deno.TestFunction,
skip = false ignore = false
): Promise<void> { ): Promise<void> {
const name = t.name; const name = t.name;
async function fn(): Promise<void> { async function fn(): Promise<void> {
@ -23,7 +23,7 @@ export async function testWalk(
await remove(d, { recursive: true }); await remove(d, { recursive: true });
} }
} }
Deno.test({ skip, name: `[walk] ${name}`, fn }); Deno.test({ ignore, name: `[walk] ${name}`, fn });
} }
function normalize({ filename }: WalkInfo): string { function normalize({ filename }: WalkInfo): string {

View file

@ -346,7 +346,7 @@ test(async function requestBodyReaderWithTransferEncoding(): Promise<void> {
test({ test({
name: "destroyed connection", name: "destroyed connection",
// FIXME(bartlomieju): hangs on windows, cause can't do `Deno.kill` // FIXME(bartlomieju): hangs on windows, cause can't do `Deno.kill`
skip: true, ignore: true,
fn: async (): Promise<void> => { fn: async (): Promise<void> => {
// Runs a simple server as another process // Runs a simple server as another process
const p = Deno.run({ const p = Deno.run({
@ -387,7 +387,7 @@ test({
test({ test({
name: "serveTLS", name: "serveTLS",
// FIXME(bartlomieju): hangs on windows, cause can't do `Deno.kill` // FIXME(bartlomieju): hangs on windows, cause can't do `Deno.kill`
skip: true, ignore: true,
fn: async (): Promise<void> => { fn: async (): Promise<void> => {
// Runs a simple server as another process // Runs a simple server as another process
const p = Deno.run({ const p = Deno.run({
@ -459,7 +459,7 @@ test("close server while iterating", async (): Promise<void> => {
// We need to find a way to similarly trigger an error on Windows so that // We need to find a way to similarly trigger an error on Windows so that
// we can test if connection is closed. // we can test if connection is closed.
test({ test({
skip: Deno.build.os == "win", ignore: Deno.build.os == "win",
name: "respond error handling", name: "respond error handling",
async fn(): Promise<void> { async fn(): Promise<void> {
const connClosedPromise = deferred(); const connClosedPromise = deferred();

View file

@ -5,7 +5,7 @@ import { chmod, chmodSync } from "./_fs_chmod.ts";
test({ test({
name: "ASYNC: Permissions are changed (non-Windows)", name: "ASYNC: Permissions are changed (non-Windows)",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
async fn() { async fn() {
const tempFile: string = await Deno.makeTempFile(); const tempFile: string = await Deno.makeTempFile();
const originalFileMode: number | null = (await Deno.lstat(tempFile)).mode; const originalFileMode: number | null = (await Deno.lstat(tempFile)).mode;
@ -31,7 +31,7 @@ test({
test({ test({
name: "SYNC: Permissions are changed (non-Windows)", name: "SYNC: Permissions are changed (non-Windows)",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
fn() { fn() {
const tempFile: string = Deno.makeTempFileSync(); const tempFile: string = Deno.makeTempFileSync();
const originalFileMode: number | null = Deno.lstatSync(tempFile).mode; const originalFileMode: number | null = Deno.lstatSync(tempFile).mode;

View file

@ -4,10 +4,10 @@ import { fail, assertEquals } from "../../testing/asserts.ts";
import { chown, chownSync } from "./_fs_chown.ts"; import { chown, chownSync } from "./_fs_chown.ts";
//chown is difficult to test. Best we can do is set the existing user id/group id again //chown is difficult to test. Best we can do is set the existing user id/group id again
const skip = Deno.build.os == "win"; const ignore = Deno.build.os == "win";
test({ test({
skip, ignore,
name: "ASYNC: setting existing uid/gid works as expected (non-Windows)", name: "ASYNC: setting existing uid/gid works as expected (non-Windows)",
async fn() { async fn() {
const tempFile: string = await Deno.makeTempFile(); const tempFile: string = await Deno.makeTempFile();
@ -35,7 +35,7 @@ test({
}); });
test({ test({
skip, ignore,
name: "SYNC: setting existing uid/gid works as expected (non-Windows)", name: "SYNC: setting existing uid/gid works as expected (non-Windows)",
fn() { fn() {
const tempFile: string = Deno.makeTempFileSync(); const tempFile: string = Deno.makeTempFileSync();

View file

@ -12,7 +12,7 @@ if (Deno.build.os !== "win") {
test({ test({
name: "readlinkSuccess", name: "readlinkSuccess",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
async fn() { async fn() {
const data = await new Promise((res, rej) => { const data = await new Promise((res, rej) => {
readlink(newname, (err, data) => { readlink(newname, (err, data) => {
@ -30,7 +30,7 @@ test({
test({ test({
name: "readlinkEncodeBufferSuccess", name: "readlinkEncodeBufferSuccess",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
async fn() { async fn() {
const data = await new Promise((res, rej) => { const data = await new Promise((res, rej) => {
readlink(newname, { encoding: "buffer" }, (err, data) => { readlink(newname, { encoding: "buffer" }, (err, data) => {
@ -48,7 +48,7 @@ test({
test({ test({
name: "readlinkSyncSuccess", name: "readlinkSyncSuccess",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
fn() { fn() {
const data = readlinkSync(newname); const data = readlinkSync(newname);
assertEquals(typeof data, "string"); assertEquals(typeof data, "string");
@ -58,7 +58,7 @@ test({
test({ test({
name: "readlinkEncodeBufferSuccess", name: "readlinkEncodeBufferSuccess",
skip: Deno.build.os === "win", ignore: Deno.build.os === "win",
fn() { fn() {
const data = readlinkSync(newname, { encoding: "buffer" }); const data = readlinkSync(newname, { encoding: "buffer" });
assert(data instanceof Uint8Array); assert(data instanceof Uint8Array);

View file

@ -19,7 +19,7 @@ function reader(s: string): TextProtoReader {
} }
test({ test({
skip: true, ignore: true,
name: "[textproto] Reader : DotBytes", name: "[textproto] Reader : DotBytes",
async fn(): Promise<void> { async fn(): Promise<void> {
const _input = const _input =