Skip to content

Commit

Permalink
Merge pull request #234 from msgpack/test-node-20
Browse files Browse the repository at this point in the history
fix CI, add node v20, remove node v14
  • Loading branch information
gfx authored Sep 8, 2023
2 parents 1234418 + 5b0f25e commit 1fc7622
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 28 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
strategy:
matrix:
node-version:
- '14'
- '16'
- '18'
- '20'

steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +25,6 @@ jobs:
cache: npm
node-version: ${{ matrix.node-version }}

- run: npm install -g npm
- run: npm install -g nyc codecov
- run: npm ci
- run: npm run test:cover
Expand All @@ -43,7 +42,7 @@ jobs:
uses: actions/setup-node@v2
with:
cache: npm
node-version: '16'
node-version: '18'
- run: npm install -g npm
- run: npm ci
- run: npm run test:browser -- --browsers ${{ matrix.browser }}
2 changes: 2 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ jobs:
cache: npm
node-version: "18"

# npm@9 may fail with https://github.com/npm/cli/issues/6723
- run: npm install -g npm@8
- run: npm ci
- run: npm run test:fuzz
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type { EncodeOptions };
import { decode, decodeMulti } from "./decode";
export { decode, decodeMulti };
import type { DecodeOptions } from "./decode";
export { DecodeOptions };
export type { DecodeOptions };

import { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream } from "./decodeAsync";
export { decodeAsync, decodeArrayStream, decodeMultiStream, decodeStream };
Expand Down
2 changes: 1 addition & 1 deletion test/CachedKeyDecoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { CachedKeyDecoder, KeyDecoder } from "../src/CachedKeyDecoder";
import { utf8EncodeJs, utf8Count } from "../src/utils/utf8";

Expand Down
4 changes: 2 additions & 2 deletions test/ExtensionCodec.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "node:assert";
import util from "node:util";
import assert from "assert";
import util from "util";
import { encode, decode, ExtensionCodec, decodeAsync } from "../src";

describe("ExtensionCodec", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/bigint64.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode } from "../src";

describe("useBigInt64: true", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/codec-bigint.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode, ExtensionCodec, DecodeError } from "../src";

// There's a built-in `useBigInt64: true` option, but a custom codec might be
Expand Down
2 changes: 1 addition & 1 deletion test/codec-float.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { decode } from "../src";
import * as ieee754 from "ieee754";

Expand Down
2 changes: 1 addition & 1 deletion test/codec-int.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { setInt64, getInt64, getUint64, setUint64 } from "../src/utils/int";

const INT64SPECS = {
Expand Down
4 changes: 2 additions & 2 deletions test/codec-timestamp.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "node:assert";
import util from "node:util";
import assert from "assert";
import util from "util";
import {
encode,
decode,
Expand Down
2 changes: 1 addition & 1 deletion test/decode-blob.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode, decodeAsync } from "@msgpack/msgpack";

(typeof Blob !== "undefined" ? describe : describe.skip)("Blob", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decode-max-length.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode, decodeAsync } from "../src";
import type { DecoderOptions } from "../src";

Expand Down
2 changes: 1 addition & 1 deletion test/decodeArrayStream.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decodeArrayStream } from "../src";

describe("decodeArrayStream", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeAsync.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decodeAsync } from "../src";

describe("decodeAsync", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeMulti.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decodeMulti } from "@msgpack/msgpack";

describe("decodeMulti", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeMultiStream.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decodeMultiStream } from "@msgpack/msgpack";

describe("decodeStream", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/edge-cases.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// kind of hand-written fuzzing data
// any errors should not break Encoder/Decoder instance states
import assert from "node:assert";
import assert from "assert";
import { encode, decodeAsync, decode, Encoder, Decoder, decodeMulti, decodeMultiStream } from "../src";
import { DataViewIndexOutOfBoundsError } from "../src/Decoder";

Expand Down
2 changes: 1 addition & 1 deletion test/encode.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode } from "@msgpack/msgpack";

describe("encode", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/msgpack-ext.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from "node:assert";
import assert from "assert";
import { encode, decode, ExtData } from "../src";

function seq(n: number) {
Expand Down
4 changes: 2 additions & 2 deletions test/msgpack-test-suite.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "node:assert";
import util from "node:util";
import assert from "assert";
import util from "util";
import { Exam } from "msgpack-test-js";
import { MsgTimestamp } from "msg-timestamp";
import { encode, decode, ExtensionCodec, EXT_TIMESTAMP, encodeTimeSpecToTimestamp } from "@msgpack/msgpack";
Expand Down
2 changes: 1 addition & 1 deletion test/prototype-pollution.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { throws } from "node:assert";
import { throws } from "assert";
import { encode, decode, DecodeError } from "@msgpack/msgpack";

describe("prototype pollution", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/readme.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepStrictEqual } from "node:assert";
import { deepStrictEqual } from "assert";
import { encode, decode } from "@msgpack/msgpack";

describe("README", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/reuse-instances.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepStrictEqual } from "node:assert";
import { deepStrictEqual } from "assert";
import { Encoder, Decoder, decode } from "@msgpack/msgpack";

const createStream = async function* (...args: any) {
Expand Down
2 changes: 1 addition & 1 deletion test/whatwg-streams.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepStrictEqual } from "node:assert";
import { deepStrictEqual } from "assert";
import { decodeAsync, encode, decodeArrayStream } from "@msgpack/msgpack";

const isReadableStreamConstructorAvailable: boolean = (() => {
Expand Down

0 comments on commit 1fc7622

Please sign in to comment.