mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-02 05:23:21 +00:00
chore: Update deps
This commit is contained in:
20
lib/node_modules/@deno/shim-deno-test/LICENSE
generated
vendored
Normal file
20
lib/node_modules/@deno/shim-deno-test/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
MIT License
|
||||
|
||||
Copyright 2021-2022 the Deno authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
28
lib/node_modules/@deno/shim-deno-test/README.md
generated
vendored
Normal file
28
lib/node_modules/@deno/shim-deno-test/README.md
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# @deno/shim-deno-test
|
||||
|
||||
Subset of [@deno/shim-deno](https://www.npmjs.com/package/@deno/shim-deno) for
|
||||
only `Deno.test`.
|
||||
|
||||
```ts
|
||||
import { Deno, test, testDefinitions } from "@deno/shim-deno-test";
|
||||
|
||||
Deno.test("some test", () => {
|
||||
// test here
|
||||
});
|
||||
|
||||
// or
|
||||
test("some other test", () => {
|
||||
// test here
|
||||
});
|
||||
|
||||
// read from testDefinitions here
|
||||
testDefinitions.length === 2;
|
||||
```
|
||||
|
||||
## Note - Not a Test Runner
|
||||
|
||||
This shim is not a test runner. It simply collects tests into the
|
||||
`testDefinitions` array. The idea is that you run a module that does `Deno.test`
|
||||
calls and then you splice out the test definitions from `testDefinitions` (ex.
|
||||
`const definitions = testDefinitions.splice(0, testDefinitions.length)`) and
|
||||
provide those to a test runner.
|
||||
3
lib/node_modules/@deno/shim-deno-test/dist/definitions.d.ts
generated
vendored
Normal file
3
lib/node_modules/@deno/shim-deno-test/dist/definitions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TestDefinition } from "./deno.types.gen.js";
|
||||
/** Reference to the array that `Deno.test` calls insert their definition into. */
|
||||
export declare const testDefinitions: TestDefinition[];
|
||||
5
lib/node_modules/@deno/shim-deno-test/dist/definitions.js
generated
vendored
Normal file
5
lib/node_modules/@deno/shim-deno-test/dist/definitions.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.testDefinitions = void 0;
|
||||
/** Reference to the array that `Deno.test` calls insert their definition into. */
|
||||
exports.testDefinitions = [];
|
||||
495
lib/node_modules/@deno/shim-deno-test/dist/deno.types.gen.d.ts
generated
vendored
Normal file
495
lib/node_modules/@deno/shim-deno-test/dist/deno.types.gen.d.ts
generated
vendored
Normal file
@@ -0,0 +1,495 @@
|
||||
/// <reference types="node" />
|
||||
import { URL } from "url";
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required.
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "example test",
|
||||
* fn() {
|
||||
* assertEquals("world", "world");
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "example ignored test",
|
||||
* ignore: Deno.build.os === "windows",
|
||||
* fn() {
|
||||
* // This test is ignored only on Windows machines
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "example async test",
|
||||
* async fn() {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(t: TestDefinition): void;
|
||||
/** @category Testing */
|
||||
export interface TestDefinition {
|
||||
fn: (t: TestContext) => void | Promise<void>;
|
||||
/** The name of the test. */
|
||||
name: string;
|
||||
/**
|
||||
* If truthy the current test step will be ignored.
|
||||
*
|
||||
* It is a quick way to skip over a step, but also can be used for
|
||||
* conditional logic, like determining if an environment feature is present.
|
||||
*/
|
||||
ignore?: boolean;
|
||||
/**
|
||||
* If at least one test has `only` set to `true`, only run tests that have
|
||||
* `only` set to `true` and fail the test suite.
|
||||
*/
|
||||
only?: boolean;
|
||||
/**
|
||||
* Check that the number of async completed operations after the test step
|
||||
* is the same as number of dispatched operations. This ensures that the
|
||||
* code tested does not start async operations which it then does
|
||||
* not await. This helps in preventing logic errors and memory leaks
|
||||
* in the application code.
|
||||
*
|
||||
* Defaults to `true`.
|
||||
*/
|
||||
sanitizeOps?: boolean;
|
||||
/**
|
||||
* Ensure the test step does not "leak" resources - like open files or
|
||||
* network connections - by ensuring the open resources at the start of the
|
||||
* test match the open resources at the end of the test.
|
||||
*
|
||||
* Defaults to `true`.
|
||||
*/
|
||||
sanitizeResources?: boolean;
|
||||
/**
|
||||
* Ensure the test case does not prematurely cause the process to exit,
|
||||
* for example via a call to {@linkcode Deno.exit}.
|
||||
*
|
||||
* Defaults to `true`.
|
||||
*/
|
||||
sanitizeExit?: boolean;
|
||||
/**
|
||||
* Specifies the permissions that should be used to run the test.
|
||||
*
|
||||
* Set this to "inherit" to keep the calling runtime permissions, set this
|
||||
* to "none" to revoke all permissions, or set a more specific set of
|
||||
* permissions using a {@linkcode PermissionOptionsObject}.
|
||||
*
|
||||
* Defaults to `"inherit"`.
|
||||
*/
|
||||
permissions?: PermissionOptions;
|
||||
}
|
||||
/**
|
||||
* Context that is passed to a testing function, which can be used to either
|
||||
* gain information about the current test, or register additional test
|
||||
* steps within the current test.
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export interface TestContext {
|
||||
/** The current test name. */
|
||||
name: string;
|
||||
/** The string URL of the current test. */
|
||||
origin: string;
|
||||
/**
|
||||
* If the current test is a step of another test, the parent test context
|
||||
* will be set here.
|
||||
*/
|
||||
parent?: TestContext;
|
||||
/**
|
||||
* Run a sub step of the parent test or step. Returns a promise
|
||||
* that resolves to a boolean signifying if the step completed successfully.
|
||||
*
|
||||
* The returned promise never rejects unless the arguments are invalid.
|
||||
*
|
||||
* If the test was ignored the promise returns `false`.
|
||||
*
|
||||
* ```ts
|
||||
* Deno.test({
|
||||
* name: "a parent test",
|
||||
* async fn(t) {
|
||||
* console.log("before the step");
|
||||
* await t.step({
|
||||
* name: "step 1",
|
||||
* fn(t) {
|
||||
* console.log("current step:", t.name);
|
||||
* }
|
||||
* });
|
||||
* console.log("after the step");
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
step(definition: TestStepDefinition): Promise<boolean>;
|
||||
/**
|
||||
* Run a sub step of the parent test or step. Returns a promise
|
||||
* that resolves to a boolean signifying if the step completed successfully.
|
||||
*
|
||||
* The returned promise never rejects unless the arguments are invalid.
|
||||
*
|
||||
* If the test was ignored the promise returns `false`.
|
||||
*
|
||||
* ```ts
|
||||
* Deno.test(
|
||||
* "a parent test",
|
||||
* async (t) => {
|
||||
* console.log("before the step");
|
||||
* await t.step(
|
||||
* "step 1",
|
||||
* (t) => {
|
||||
* console.log("current step:", t.name);
|
||||
* }
|
||||
* );
|
||||
* console.log("after the step");
|
||||
* }
|
||||
* );
|
||||
* ```
|
||||
*/
|
||||
step(name: string, fn: (t: TestContext) => void | Promise<void>): Promise<boolean>;
|
||||
}
|
||||
/** @category Testing */
|
||||
export interface TestStepDefinition {
|
||||
/**
|
||||
* The test function that will be tested when this step is executed. The
|
||||
* function can take an argument which will provide information about the
|
||||
* current step's context.
|
||||
*/
|
||||
fn: (t: TestContext) => void | Promise<void>;
|
||||
/** The name of the step. */
|
||||
name: string;
|
||||
/**
|
||||
* If truthy the current test step will be ignored.
|
||||
*
|
||||
* This is a quick way to skip over a step, but also can be used for
|
||||
* conditional logic, like determining if an environment feature is present.
|
||||
*/
|
||||
ignore?: boolean;
|
||||
/**
|
||||
* Check that the number of async completed operations after the test step
|
||||
* is the same as number of dispatched operations. This ensures that the
|
||||
* code tested does not start async operations which it then does
|
||||
* not await. This helps in preventing logic errors and memory leaks
|
||||
* in the application code.
|
||||
*
|
||||
* Defaults to the parent test or step's value.
|
||||
*/
|
||||
sanitizeOps?: boolean;
|
||||
/**
|
||||
* Ensure the test step does not "leak" resources - like open files or
|
||||
* network connections - by ensuring the open resources at the start of the
|
||||
* step match the open resources at the end of the step.
|
||||
*
|
||||
* Defaults to the parent test or step's value.
|
||||
*/
|
||||
sanitizeResources?: boolean;
|
||||
/**
|
||||
* Ensure the test step does not prematurely cause the process to exit,
|
||||
* for example via a call to {@linkcode Deno.exit}.
|
||||
*
|
||||
* Defaults to the parent test or step's value.
|
||||
*/
|
||||
sanitizeExit?: boolean;
|
||||
}
|
||||
/**
|
||||
* A set of options which can define the permissions within a test or worker
|
||||
* context at a highly specific level.
|
||||
*
|
||||
* @category Permissions
|
||||
*/
|
||||
export interface PermissionOptionsObject {
|
||||
/**
|
||||
* Specifies if the `env` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `env` permission will be inherited.
|
||||
* If set to `true`, the global `env` permission will be requested.
|
||||
* If set to `false`, the global `env` permission will be revoked.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
env?: "inherit" | boolean | string[];
|
||||
/**
|
||||
* Specifies if the `sys` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `sys` permission will be inherited.
|
||||
* If set to `true`, the global `sys` permission will be requested.
|
||||
* If set to `false`, the global `sys` permission will be revoked.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
sys?: "inherit" | boolean | string[];
|
||||
/**
|
||||
* Specifies if the `hrtime` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `hrtime` permission will be inherited.
|
||||
* If set to `true`, the global `hrtime` permission will be requested.
|
||||
* If set to `false`, the global `hrtime` permission will be revoked.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
hrtime?: "inherit" | boolean;
|
||||
/**
|
||||
* Specifies if the `net` permission should be requested or revoked.
|
||||
* if set to `"inherit"`, the current `net` permission will be inherited.
|
||||
* if set to `true`, the global `net` permission will be requested.
|
||||
* if set to `false`, the global `net` permission will be revoked.
|
||||
* if set to `string[]`, the `net` permission will be requested with the
|
||||
* specified host strings with the format `"<host>[:<port>]`.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "inherit",
|
||||
* permissions: {
|
||||
* net: "inherit",
|
||||
* },
|
||||
* async fn() {
|
||||
* const status = await Deno.permissions.query({ name: "net" })
|
||||
* assertEquals(status.state, "granted");
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "true",
|
||||
* permissions: {
|
||||
* net: true,
|
||||
* },
|
||||
* async fn() {
|
||||
* const status = await Deno.permissions.query({ name: "net" });
|
||||
* assertEquals(status.state, "granted");
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "false",
|
||||
* permissions: {
|
||||
* net: false,
|
||||
* },
|
||||
* async fn() {
|
||||
* const status = await Deno.permissions.query({ name: "net" });
|
||||
* assertEquals(status.state, "denied");
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test({
|
||||
* name: "localhost:8080",
|
||||
* permissions: {
|
||||
* net: ["localhost:8080"],
|
||||
* },
|
||||
* async fn() {
|
||||
* const status = await Deno.permissions.query({ name: "net", host: "localhost:8080" });
|
||||
* assertEquals(status.state, "granted");
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
net?: "inherit" | boolean | string[];
|
||||
/**
|
||||
* Specifies if the `ffi` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `ffi` permission will be inherited.
|
||||
* If set to `true`, the global `ffi` permission will be requested.
|
||||
* If set to `false`, the global `ffi` permission will be revoked.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
ffi?: "inherit" | boolean | Array<string | URL>;
|
||||
/**
|
||||
* Specifies if the `read` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `read` permission will be inherited.
|
||||
* If set to `true`, the global `read` permission will be requested.
|
||||
* If set to `false`, the global `read` permission will be revoked.
|
||||
* If set to `Array<string | URL>`, the `read` permission will be requested with the
|
||||
* specified file paths.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
read?: "inherit" | boolean | Array<string | URL>;
|
||||
/**
|
||||
* Specifies if the `run` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `run` permission will be inherited.
|
||||
* If set to `true`, the global `run` permission will be requested.
|
||||
* If set to `false`, the global `run` permission will be revoked.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
run?: "inherit" | boolean | Array<string | URL>;
|
||||
/**
|
||||
* Specifies if the `write` permission should be requested or revoked.
|
||||
* If set to `"inherit"`, the current `write` permission will be inherited.
|
||||
* If set to `true`, the global `write` permission will be requested.
|
||||
* If set to `false`, the global `write` permission will be revoked.
|
||||
* If set to `Array<string | URL>`, the `write` permission will be requested with the
|
||||
* specified file paths.
|
||||
*
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
write?: "inherit" | boolean | Array<string | URL>;
|
||||
}
|
||||
/**
|
||||
* Options which define the permissions within a test or worker context.
|
||||
*
|
||||
* `"inherit"` ensures that all permissions of the parent process will be
|
||||
* applied to the test context. `"none"` ensures the test context has no
|
||||
* permissions. A `PermissionOptionsObject` provides a more specific
|
||||
* set of permissions to the test context.
|
||||
*
|
||||
* @category Permissions
|
||||
*/
|
||||
export declare type PermissionOptions = "inherit" | "none" | PermissionOptionsObject;
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required.
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test("My test description", () => {
|
||||
* assertEquals("hello", "hello");
|
||||
* });
|
||||
*
|
||||
* Deno.test("My async test description", async () => {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(name: string, fn: (t: TestContext) => void | Promise<void>): void;
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required. Declared function must have a name.
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test(function myTestName() {
|
||||
* assertEquals("hello", "hello");
|
||||
* });
|
||||
*
|
||||
* Deno.test(async function myOtherTestName() {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(fn: (t: TestContext) => void | Promise<void>): void;
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required.
|
||||
*
|
||||
* ```ts
|
||||
* import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test("My test description", { permissions: { read: true } }, (): void => {
|
||||
* assertEquals("hello", "hello");
|
||||
* });
|
||||
*
|
||||
* Deno.test("My async test description", { permissions: { read: false } }, async (): Promise<void> => {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(name: string, options: Omit<TestDefinition, "fn" | "name">, fn: (t: TestContext) => void | Promise<void>): void;
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required.
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test(
|
||||
* {
|
||||
* name: "My test description",
|
||||
* permissions: { read: true },
|
||||
* },
|
||||
* () => {
|
||||
* assertEquals("hello", "hello");
|
||||
* },
|
||||
* );
|
||||
*
|
||||
* Deno.test(
|
||||
* {
|
||||
* name: "My async test description",
|
||||
* permissions: { read: false },
|
||||
* },
|
||||
* async () => {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(options: Omit<TestDefinition, "fn">, fn: (t: TestContext) => void | Promise<void>): void;
|
||||
/**
|
||||
* Register a test which will be run when `deno test` is used on the command
|
||||
* line and the containing module looks like a test module.
|
||||
*
|
||||
* `fn` can be async if required. Declared function must have a name.
|
||||
*
|
||||
* ```ts
|
||||
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
||||
*
|
||||
* Deno.test(
|
||||
* { permissions: { read: true } },
|
||||
* function myTestName() {
|
||||
* assertEquals("hello", "hello");
|
||||
* },
|
||||
* );
|
||||
*
|
||||
* Deno.test(
|
||||
* { permissions: { read: false } },
|
||||
* async function myOtherTestName() {
|
||||
* const decoder = new TextDecoder("utf-8");
|
||||
* const data = await Deno.readFile("hello_world.txt");
|
||||
* assertEquals(decoder.decode(data), "Hello world");
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* @category Testing
|
||||
*/
|
||||
export declare function test(options: Omit<TestDefinition, "fn" | "name">, fn: (t: TestContext) => void | Promise<void>): void;
|
||||
2
lib/node_modules/@deno/shim-deno-test/dist/deno.types.gen.js
generated
vendored
Normal file
2
lib/node_modules/@deno/shim-deno-test/dist/deno.types.gen.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
3
lib/node_modules/@deno/shim-deno-test/dist/index.d.ts
generated
vendored
Normal file
3
lib/node_modules/@deno/shim-deno-test/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * as Deno from "./test.js";
|
||||
export * from "./test.js";
|
||||
export { testDefinitions } from "./definitions.js";
|
||||
21
lib/node_modules/@deno/shim-deno-test/dist/index.js
generated
vendored
Normal file
21
lib/node_modules/@deno/shim-deno-test/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.testDefinitions = exports.Deno = void 0;
|
||||
exports.Deno = require("./test.js");
|
||||
__exportStar(require("./test.js"), exports);
|
||||
var definitions_js_1 = require("./definitions.js");
|
||||
Object.defineProperty(exports, "testDefinitions", { enumerable: true, get: function () { return definitions_js_1.testDefinitions; } });
|
||||
3
lib/node_modules/@deno/shim-deno-test/dist/test.d.ts
generated
vendored
Normal file
3
lib/node_modules/@deno/shim-deno-test/dist/test.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as Deno from "./deno.types.gen.js";
|
||||
export type { TestContext, TestDefinition, TestStepDefinition, } from "./deno.types.gen.js";
|
||||
export declare const test: typeof Deno.test;
|
||||
72
lib/node_modules/@deno/shim-deno-test/dist/test.js
generated
vendored
Normal file
72
lib/node_modules/@deno/shim-deno-test/dist/test.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.test = void 0;
|
||||
const definitions_js_1 = require("./definitions.js");
|
||||
const test = function test() {
|
||||
var _a, _b;
|
||||
let testDef;
|
||||
const firstArg = arguments[0];
|
||||
const secondArg = arguments[1];
|
||||
const thirdArg = arguments[2];
|
||||
if (typeof firstArg === "string") {
|
||||
if (typeof secondArg === "object") {
|
||||
if (typeof thirdArg === "function") {
|
||||
if (secondArg.fn != null) {
|
||||
throw new TypeError("Unexpected 'fn' field in options, test function is already provided as the third argument.");
|
||||
}
|
||||
}
|
||||
if (secondArg.name != null) {
|
||||
throw new TypeError("Unexpected 'name' field in options, test name is already provided as the first argument.");
|
||||
}
|
||||
// name, options, fn
|
||||
testDef = { name: firstArg, fn: thirdArg, ...secondArg };
|
||||
}
|
||||
else {
|
||||
// name, fn
|
||||
testDef = { name: firstArg, fn: secondArg };
|
||||
}
|
||||
}
|
||||
else if (firstArg instanceof Function) {
|
||||
// function only
|
||||
if (firstArg.name.length === 0) {
|
||||
throw new TypeError("The test function must have a name");
|
||||
}
|
||||
testDef = { fn: firstArg, name: firstArg.name };
|
||||
if (secondArg != null) {
|
||||
throw new TypeError("Unexpected second argument to Deno.test()");
|
||||
}
|
||||
}
|
||||
else if (typeof firstArg === "object") {
|
||||
testDef = { ...firstArg };
|
||||
if (typeof secondArg === "function") {
|
||||
// options, fn
|
||||
testDef.fn = secondArg;
|
||||
if (firstArg.fn != null) {
|
||||
throw new TypeError("Unexpected 'fn' field in options, test function is already provided as the second argument.");
|
||||
}
|
||||
if (testDef.name == null) {
|
||||
if (secondArg.name.length === 0) {
|
||||
throw new TypeError("The test function must have a name");
|
||||
}
|
||||
// options without name, fn
|
||||
testDef.name = secondArg.name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (typeof firstArg.fn !== "function") {
|
||||
throw new TypeError("Expected 'fn' field in the first argument to be a test function.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError("Unknown test overload");
|
||||
}
|
||||
if (typeof testDef.fn !== "function") {
|
||||
throw new TypeError("Missing test function");
|
||||
}
|
||||
if (((_b = (_a = testDef.name) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0) {
|
||||
throw new TypeError("The test name can't be empty");
|
||||
}
|
||||
definitions_js_1.testDefinitions.push(testDef);
|
||||
};
|
||||
exports.test = test;
|
||||
34
lib/node_modules/@deno/shim-deno-test/package.json
generated
vendored
Normal file
34
lib/node_modules/@deno/shim-deno-test/package.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "@deno/shim-deno-test",
|
||||
"version": "0.4.0",
|
||||
"description": "Deno.test only shim.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "npm run generate-deno-types && tsc",
|
||||
"generate-deno-types": "deno run --allow-read --allow-write=. ./scripts/generateDenoTypes.ts",
|
||||
"test": "echo 'tested by shim-deno package.'"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/denoland/node_deno_shims.git"
|
||||
},
|
||||
"keywords": [
|
||||
"shim",
|
||||
"deno",
|
||||
"test",
|
||||
"node.js"
|
||||
],
|
||||
"author": "The Deno authors",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/denoland/node_deno_shims/issues"
|
||||
},
|
||||
"homepage": "https://github.com/denoland/node_deno_shims#readme",
|
||||
"devDependencies": {
|
||||
"typescript": "^4.7.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user