@denofill/testing
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "@denofill/testing", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "🧪 Deno.test() and Deno.bench() for anywhere", | ||
@@ -76,3 +76,2 @@ "keywords": [ | ||
"serve": "^14.2.0", | ||
"tsx": "^3.12.7", | ||
"typedoc": "^0.24.8", | ||
@@ -92,3 +91,13 @@ "typescript": "^5.1.6", | ||
"skipErrorChecking": true | ||
}, | ||
"dependencies": { | ||
"execa": "^8.0.0", | ||
"glob": "^10.3.3", | ||
"ts-dedent": "^2.2.0", | ||
"tsx": "^3.12.7" | ||
}, | ||
"bin": { | ||
"denofilltest": "./dist/denofilltest.js", | ||
"denofillbench": "./dist/denofillbench.js" | ||
} | ||
} |
@@ -1,1 +0,65 @@ | ||
# testing | ||
# Deno testing for anywhere | ||
🧪 [`Deno.test()`] and [`Deno.bench()`] for anywhere | ||
## Installation | ||
You can install this package using npm, pnpm, Yarn, or your other favorite npm | ||
package manager: | ||
```sh | ||
npm install @denofill/testing | ||
``` | ||
## Usage | ||
You can import this package in Node.js, Deno, and the browser and it will Just | ||
Work™. In Deno, you'll get a passthrough to the native `Deno.test()` function, | ||
while in Node.js and the browser you'll get a shim that implements the same API. | ||
```js | ||
// If you set DENOFILL_TEST=1 in Node.js, this will run the tests. Otherwise, | ||
// this will be a no-op. | ||
import * as Deno from "@denofill/testing"; | ||
import assert from "node:assert"; | ||
Deno.test("1 + 2 = 3", () => { | ||
assert.equal(1 + 2, 3); | ||
}); | ||
``` | ||
```html | ||
<script> | ||
// You can also manually do this in DevTools and reload the page. | ||
sessionStorage.setItem("denofill_test", "1"); | ||
</script> | ||
<script type="module"> | ||
import * as Deno from "https://esm.run/@denofill/testing"; | ||
import assert from "https://esm.run/@nodefill/assert"; | ||
Deno.test("1 + 2 = 3", () => { | ||
assert.equal(1 + 2, 3); | ||
}); | ||
</script> | ||
``` | ||
⚠️ Even though it kinda looks like it, the `Deno` import is **not** the real | ||
Deno namespace object! It's only got two functions: `Deno.test()` and | ||
`Deno.bench()`. | ||
You can also use the shim CLI to run tests and benchmarks using `tsx`: | ||
```sh | ||
denofilltest | ||
denofillbench | ||
``` | ||
<details><summary>You can combine this <code>Deno</code> namespace with other <a href="https://github.com/denofill">@denofill</a> modules to build a custom Deno namespace</summary> | ||
```js | ||
import * as Deno1 from "@denofill/testing"; | ||
import * as Deno2 from "@denofill/http-server"; | ||
const Deno = { ...Deno1, ...Deno2 }; | ||
``` | ||
</details> |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
8
66
2
40215
4
1105
+ Addedexeca@^8.0.0
+ Addedglob@^10.3.3
+ Addedts-dedent@^2.2.0
+ Addedtsx@^3.12.7
+ Added@esbuild/android-arm@0.18.20(transitive)
+ Added@esbuild/android-arm64@0.18.20(transitive)
+ Added@esbuild/android-x64@0.18.20(transitive)
+ Added@esbuild/darwin-arm64@0.18.20(transitive)
+ Added@esbuild/darwin-x64@0.18.20(transitive)
+ Added@esbuild/freebsd-arm64@0.18.20(transitive)
+ Added@esbuild/freebsd-x64@0.18.20(transitive)
+ Added@esbuild/linux-arm@0.18.20(transitive)
+ Added@esbuild/linux-arm64@0.18.20(transitive)
+ Added@esbuild/linux-ia32@0.18.20(transitive)
+ Added@esbuild/linux-loong64@0.18.20(transitive)
+ Added@esbuild/linux-mips64el@0.18.20(transitive)
+ Added@esbuild/linux-ppc64@0.18.20(transitive)
+ Added@esbuild/linux-riscv64@0.18.20(transitive)
+ Added@esbuild/linux-s390x@0.18.20(transitive)
+ Added@esbuild/linux-x64@0.18.20(transitive)
+ Added@esbuild/netbsd-x64@0.18.20(transitive)
+ Added@esbuild/openbsd-x64@0.18.20(transitive)
+ Added@esbuild/sunos-x64@0.18.20(transitive)
+ Added@esbuild/win32-arm64@0.18.20(transitive)
+ Added@esbuild/win32-ia32@0.18.20(transitive)
+ Added@esbuild/win32-x64@0.18.20(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedesbuild@0.18.20(transitive)
+ Addedexeca@8.0.1(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-stream@8.0.1(transitive)
+ Addedget-tsconfig@4.10.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedhuman-signals@5.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-stream@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@4.0.0(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addednpm-run-path@5.3.0(transitive)
+ Addedonetime@6.0.0(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.14.0.0(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedresolve-pkg-maps@1.0.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstrip-final-newline@3.0.0(transitive)
+ Addedts-dedent@2.2.0(transitive)
+ Addedtsx@3.14.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)