Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c81694e

Browse filesBrowse files
committed
add test for dist.cjs with deno
1 parent b30b250 commit c81694e
Copy full SHA for c81694e

File tree

2 files changed

+13
-1
lines changed
Filter options

2 files changed

+13
-1
lines changed

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test": "mocha 'test/**/*.test.ts'",
1919
"test:dist": "npm run lint && npm run test && npm run test:deno",
2020
"test:cover": "npm run cover:clean && npx nyc --no-clean npm run 'test' && npm run cover:report",
21-
"test:deno": "deno test test/deno_test.ts",
21+
"test:deno": "deno test --allow-read test/deno_*.ts",
2222
"test:bun": "bun test test/bun.spec.ts",
2323
"test:fuzz": "npm exec --yes -- jsfuzz@git+https://gitlab.com/gitlab-org/security-products/analyzers/fuzzers/jsfuzz.git#39e6cf16613a0e30c7a7953f62e64292dbd5d3f3 --fuzzTime 60 --no-versifier test/decode.jsfuzz.js corpus",
2424
"cover:clean": "rimraf .nyc_output coverage/",

‎test/deno_cjs_test.ts

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env deno test --allow-read
2+
3+
/* eslint-disable */
4+
import { deepStrictEqual } from "node:assert";
5+
import { test } from "node:test";
6+
import * as msgpack from "../dist.cjs/index.cjs";
7+
8+
test("Hello, world!", () => {
9+
const encoded = msgpack.encode("Hello, world!");
10+
const decoded = msgpack.decode(encoded);
11+
deepStrictEqual(decoded, "Hello, world!");
12+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.