Skip to content

Commit c81694e

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

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Diff for: package.json

+1-1
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/",

Diff for: test/deno_cjs_test.ts

+12
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)