diff options
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 4 | ||||
-rw-r--r-- | cli/js/testing.ts | 23 | ||||
-rw-r--r-- | cli/js/tests/README.md | 2 | ||||
-rw-r--r-- | cli/js/tests/chmod_test.ts | 4 | ||||
-rw-r--r-- | cli/js/tests/fetch_test.ts | 8 | ||||
-rw-r--r-- | cli/js/tests/net_test.ts | 16 | ||||
-rw-r--r-- | cli/js/tests/os_test.ts | 2 | ||||
-rw-r--r-- | cli/js/tests/process_test.ts | 2 | ||||
-rw-r--r-- | cli/js/tests/realpath_test.ts | 4 | ||||
-rw-r--r-- | cli/js/tests/signal_test.ts | 8 | ||||
-rw-r--r-- | cli/js/tests/stat_test.ts | 4 | ||||
-rw-r--r-- | cli/js/tests/test_util.ts | 6 | ||||
-rw-r--r-- | cli/js/tests/umask_test.ts | 2 | ||||
-rw-r--r-- | cli/js/tests/url_test.ts | 2 |
14 files changed, 43 insertions, 44 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index ac52bb9a3..4302d5ca0 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -17,7 +17,7 @@ declare namespace Deno { export interface TestDefinition { fn: TestFunction; name: string; - skip?: boolean; + ignore?: boolean; disableOpSanitizer?: boolean; disableResourceSanitizer?: boolean; } @@ -38,7 +38,7 @@ declare namespace Deno { enum TestStatus { Passed = "passed", Failed = "failed", - Skipped = "skipped" + Ignored = "ignored" } interface TestResult { diff --git a/cli/js/testing.ts b/cli/js/testing.ts index 0d21962c0..08bb2db87 100644 --- a/cli/js/testing.ts +++ b/cli/js/testing.ts @@ -10,7 +10,7 @@ import { assert } from "./util.ts"; const RED_FAILED = red("FAILED"); const GREEN_OK = green("ok"); -const YELLOW_SKIPPED = yellow("SKIPPED"); +const YELLOW_IGNORED = yellow("ignored"); const disabledConsole = new Console((_x: string, _isErr?: boolean): void => {}); function formatDuration(time = 0): string { @@ -68,7 +68,7 @@ export type TestFunction = () => void | Promise<void>; export interface TestDefinition { fn: TestFunction; name: string; - skip?: boolean; + ignore?: boolean; disableOpSanitizer?: boolean; disableResourceSanitizer?: boolean; } @@ -93,12 +93,12 @@ export function test( if (!t) { 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") { if (!t.name) { 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 { if (!t.fn) { throw new TypeError("Missing test function"); @@ -106,8 +106,7 @@ export function test( if (!t.name) { throw new TypeError("The test name can't be empty"); } - - testDef = { ...t, skip: Boolean(t.skip) }; + testDef = { ...t, ignore: Boolean(t.ignore) }; } if (testDef.disableOpSanitizer !== true) { @@ -141,7 +140,7 @@ export interface RunTestsOptions { enum TestStatus { Passed = "passed", Failed = "failed", - Skipped = "skipped" + Ignored = "ignored" } interface TestResult { @@ -211,11 +210,11 @@ class TestApi { const results: TestResult[] = []; 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 }; yield { kind: TestEvent.TestStart, name }; - if (skip) { - result.status = TestStatus.Skipped; + if (ignore) { + result.status = TestStatus.Ignored; this.stats.ignored++; } else { const start = +new Date(); @@ -321,8 +320,8 @@ export class ConsoleTestReporter implements TestReporter { case TestStatus.Failed: this.log(`${RED_FAILED} ${formatDuration(result.duration)}`); break; - case TestStatus.Skipped: - this.log(`${YELLOW_SKIPPED} ${formatDuration(result.duration)}`); + case TestStatus.Ignored: + this.log(`${YELLOW_IGNORED} ${formatDuration(result.duration)}`); break; } } diff --git a/cli/js/tests/README.md b/cli/js/tests/README.md index 7553582d2..8d1908a2f 100644 --- a/cli/js/tests/README.md +++ b/cli/js/tests/README.md @@ -17,7 +17,7 @@ unitTest(function simpleTestFn(): void { }); unitTest({ - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { read: true, write: true }, }, function complexTestFn(): void { diff --git a/cli/js/tests/chmod_test.ts b/cli/js/tests/chmod_test.ts index 8731fad22..4720fa784 100644 --- a/cli/js/tests/chmod_test.ts +++ b/cli/js/tests/chmod_test.ts @@ -27,7 +27,7 @@ unitTest( // Check symlink when not on windows unitTest( { - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { read: true, write: true } }, function chmodSyncSymlinkSuccess(): void { @@ -103,7 +103,7 @@ unitTest( unitTest( { - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { read: true, write: true } }, async function chmodSymlinkSuccess(): Promise<void> { diff --git a/cli/js/tests/fetch_test.ts b/cli/js/tests/fetch_test.ts index 9a705c40a..67675177e 100644 --- a/cli/js/tests/fetch_test.ts +++ b/cli/js/tests/fetch_test.ts @@ -203,7 +203,7 @@ unitTest( { // FIXME(bartlomieju): // The feature below is not implemented, but the test should work after implementation - skip: true, + ignore: true, perms: { net: true } }, async function fetchWithInfRedirection(): Promise<void> { @@ -363,7 +363,7 @@ function bufferServer(addr: string): Deno.Buffer { unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function fetchRequest(): Promise<void> { @@ -393,7 +393,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function fetchPostBodyString(): Promise<void> { @@ -427,7 +427,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function fetchPostBodyTypedArray(): Promise<void> { diff --git a/cli/js/tests/net_test.ts b/cli/js/tests/net_test.ts index fccd62f38..f27dcdc19 100644 --- a/cli/js/tests/net_test.ts +++ b/cli/js/tests/net_test.ts @@ -18,7 +18,7 @@ unitTest( { perms: { net: true }, // TODO: - skip: Deno.build.os === "win" + ignore: Deno.build.os === "win" }, function netUdpListenClose(): void { const socket = Deno.listen({ @@ -111,7 +111,7 @@ unitTest({ perms: { net: true } }, async function netTcpDialListen(): Promise< }); unitTest( - { skip: Deno.build.os === "win", perms: { net: true } }, + { ignore: Deno.build.os === "win", perms: { net: true } }, async function netUdpSendReceive(): Promise<void> { const alice = Deno.listen({ port: 4500, transport: "udp" }); assertEquals(alice.addr.port, 4500); @@ -151,7 +151,7 @@ unitTest( ); unitTest( - { skip: Deno.build.os === "win", perms: { net: true } }, + { ignore: Deno.build.os === "win", perms: { net: true } }, async function netUdpListenCloseWhileIterating(): Promise<void> { const socket = Deno.listen({ port: 8000, transport: "udp" }); const nextWhileClosing = socket[Symbol.asyncIterator]().next(); @@ -166,7 +166,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function netListenAsyncIterator(): Promise<void> { @@ -201,7 +201,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function netCloseReadSuccess() { @@ -238,7 +238,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function netDoubleCloseRead() { @@ -270,7 +270,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function netCloseWriteSuccess() { @@ -309,7 +309,7 @@ unitTest( unitTest( { // FIXME(bartlomieju) - skip: true, + ignore: true, perms: { net: true } }, async function netDoubleCloseWrite() { diff --git a/cli/js/tests/os_test.ts b/cli/js/tests/os_test.ts index 0c851be51..bc1766a2b 100644 --- a/cli/js/tests/os_test.ts +++ b/cli/js/tests/os_test.ts @@ -50,7 +50,7 @@ unitTest(function envPermissionDenied2(): void { // case-insensitive. Case normalization needs be done using the collation // that Windows uses, rather than naively using String.toLowerCase(). unitTest( - { skip: Deno.build.os !== "win", perms: { env: true, run: true } }, + { ignore: Deno.build.os !== "win", perms: { env: true, run: true } }, async function envCaseInsensitive() { // Utility function that runs a Deno subprocess with the environment // specified in `inputEnv`. The subprocess reads the environment variables diff --git a/cli/js/tests/process_test.ts b/cli/js/tests/process_test.ts index 2411b5134..77c3065eb 100644 --- a/cli/js/tests/process_test.ts +++ b/cli/js/tests/process_test.ts @@ -49,7 +49,7 @@ unitTest( unitTest( { // No signals on windows. - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { run: true } }, async function runCommandFailedWithSignal(): Promise<void> { diff --git a/cli/js/tests/realpath_test.ts b/cli/js/tests/realpath_test.ts index cda7ddaf1..d185e4095 100644 --- a/cli/js/tests/realpath_test.ts +++ b/cli/js/tests/realpath_test.ts @@ -14,7 +14,7 @@ unitTest({ perms: { read: true } }, function realpathSyncSuccess(): void { unitTest( { - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { read: true, write: true } }, function realpathSyncSymlink(): void { @@ -66,7 +66,7 @@ unitTest({ perms: { read: true } }, async function realpathSuccess(): Promise< unitTest( { - skip: Deno.build.os === "win", + ignore: Deno.build.os === "win", perms: { read: true, write: true } }, async function realpathSymlink(): Promise<void> { diff --git a/cli/js/tests/signal_test.ts b/cli/js/tests/signal_test.ts index e1d00c669..e4339e290 100644 --- a/cli/js/tests/signal_test.ts +++ b/cli/js/tests/signal_test.ts @@ -14,7 +14,7 @@ function defer(n: number): Promise<void> { } unitTest( - { skip: Deno.build.os !== "win" }, + { ignore: Deno.build.os !== "win" }, async function signalsNotImplemented(): Promise<void> { assertThrows( () => { @@ -104,7 +104,7 @@ 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> { const resolvable = createResolvable(); // This prevents the program from exiting. @@ -138,7 +138,7 @@ unitTest( ); unitTest( - { skip: Deno.build.os === "win", perms: { run: true } }, + { ignore: Deno.build.os === "win", perms: { run: true } }, async function signalPromiseTest(): Promise<void> { const resolvable = createResolvable(); // This prevents the program from exiting. @@ -161,7 +161,7 @@ unitTest( ); unitTest( - { skip: Deno.build.os === "win", perms: { run: true } }, + { ignore: Deno.build.os === "win", perms: { run: true } }, async function signalShorthandsTest(): Promise<void> { let s: Deno.SignalStream; s = Deno.signals.alarm(); // for SIGALRM diff --git a/cli/js/tests/stat_test.ts b/cli/js/tests/stat_test.ts index 0a33901b7..e51204b6e 100644 --- a/cli/js/tests/stat_test.ts +++ b/cli/js/tests/stat_test.ts @@ -184,7 +184,7 @@ unitTest({ perms: { read: true } }, async function lstatNotFound(): Promise< }); 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> { const enc = new TextEncoder(); const data = enc.encode("Hello"); @@ -205,7 +205,7 @@ 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> { const enc = new TextEncoder(); const data = enc.encode("Hello"); diff --git a/cli/js/tests/test_util.ts b/cli/js/tests/test_util.ts index 851596b11..42301cf72 100644 --- a/cli/js/tests/test_util.ts +++ b/cli/js/tests/test_util.ts @@ -123,12 +123,12 @@ interface UnitTestPermissions { } interface UnitTestOptions { - skip?: boolean; + ignore?: boolean; perms?: UnitTestPermissions; } interface UnitTestDefinition extends Deno.TestDefinition { - skip: boolean; + ignore: boolean; perms: Permissions; } @@ -169,7 +169,7 @@ export function unitTest( const unitTestDefinition: UnitTestDefinition = { name, fn, - skip: !!options.skip, + ignore: !!options.ignore, perms: normalizedPerms }; diff --git a/cli/js/tests/umask_test.ts b/cli/js/tests/umask_test.ts index 543372a46..e4576c515 100644 --- a/cli/js/tests/umask_test.ts +++ b/cli/js/tests/umask_test.ts @@ -3,7 +3,7 @@ import { unitTest, assertEquals } from "./test_util.ts"; unitTest( { - skip: Deno.build.os === "win" + ignore: Deno.build.os === "win" }, function umaskSuccess(): void { const prevMask = Deno.umask(0o020); diff --git a/cli/js/tests/url_test.ts b/cli/js/tests/url_test.ts index c00bfa8d3..5b3067e4b 100644 --- a/cli/js/tests/url_test.ts +++ b/cli/js/tests/url_test.ts @@ -183,7 +183,7 @@ unitTest(function sortingNonExistentParamRemovesQuestionMarkFromURL(): void { unitTest( { // FIXME(bartlomieju) - skip: true + ignore: true }, function customInspectFunction(): void { const url = new URL("http://example.com/?"); |