diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index fd405b3..5b23aa6 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - node-version: ^18.1 + node-version: '20' - run: | npm install npm run lint @@ -25,10 +25,10 @@ jobs: strategy: matrix: - node-version: ['14', '16', '18'] + node-version: ['14', '16', '18', '20'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -43,10 +43,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - run: | npm install npm run prepare-legacy-test @@ -68,7 +68,7 @@ jobs: node-version: ['0.10', '0.12', '4', '6', '8', '10', '12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} diff --git a/package.json b/package.json index d2b9a2a..dfd8be7 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "sinon": "9", "ts-node": "latest", "tslib": "2", - "typescript": "5.0" + "typescript": "5.2" }, "peerDependencies": { "@types/mocha": ">=7", diff --git a/src/main.ts b/src/main.ts index 61bcf3e..851275d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -43,5 +43,5 @@ if (typeof self !== 'undefined') if (!installed) { const message = 'EBDD failed to set up because no Node.js or browser environment was detected.'; - throw new Error(message); + throw Error(message); } diff --git a/test/spec/ebdd-suite.spec.ts b/test/spec/ebdd-suite.spec.ts index dd14078..5162640 100644 --- a/test/spec/ebdd-suite.spec.ts +++ b/test/spec/ebdd-suite.spec.ts @@ -1,13 +1,13 @@ import type { ParamInfo, ParamOrParamInfo, ParameterizedSuiteFunction, UnparameterizedSuiteFunction } from '../../src/ebdd'; -import { EMPTY_OBJ, isArrayBased, loadEBDD } from './utils'; -import type { CallCountingStub } from './utils'; -import { deepStrictEqual, ok, strictEqual, throws } from 'assert'; -import { Suite, interfaces } from 'mocha'; -import type { Context, MochaGlobals, SuiteFunction } from 'mocha'; -import { createSandbox, spy } from 'sinon'; -import type { SinonSandbox, SinonSpy, SinonSpyCall, SinonStub } from 'sinon'; + +import { type CallCountingStub, EMPTY_OBJ, isArrayBased, loadEBDD } from './utils'; +import { deepStrictEqual, ok, strictEqual, throws } from 'assert'; +import { type Context, type MochaGlobals, Suite, type SuiteFunction, interfaces } from 'mocha'; + +import { type SinonSandbox, type SinonSpy, type SinonSpyCall, type SinonStub, createSandbox, spy } +from 'sinon'; describe ( diff --git a/test/spec/ebdd-test.spec.ts b/test/spec/ebdd-test.spec.ts index 473a754..d7b26d7 100644 --- a/test/spec/ebdd-test.spec.ts +++ b/test/spec/ebdd-test.spec.ts @@ -1,13 +1,25 @@ import type { ParamInfo, ParamOrParamInfo, ParameterizedTestFunction, UnparameterizedTestFunction } from '../../src/ebdd'; -import { EMPTY_OBJ, isArrayBased, loadEBDD } from './utils'; -import type { CallCountingStub } from './utils'; + +import { type CallCountingStub, EMPTY_OBJ, isArrayBased, loadEBDD } from './utils'; import { deepStrictEqual, ok, strictEqual, throws } from 'assert'; -import { Suite, Test, interfaces } from 'mocha'; -import type { AsyncFunc, Done, Func, MochaGlobals, TestFunction } from 'mocha'; -import { createSandbox, spy } from 'sinon'; -import type { SinonSandbox, SinonSpy, SinonSpyCall, SinonStub } from 'sinon'; + +import +{ + type AsyncFunc, + type Done, + type Func, + type MochaGlobals, + Suite, + Test, + type TestFunction, + interfaces, +} +from 'mocha'; + +import { type SinonSandbox, type SinonSpy, type SinonSpyCall, type SinonStub, createSandbox, spy } +from 'sinon'; describe ( diff --git a/test/spec/ebdd.spec.ts b/test/spec/ebdd.spec.ts index eb29396..d4de00f 100644 --- a/test/spec/ebdd.spec.ts +++ b/test/spec/ebdd.spec.ts @@ -1,10 +1,8 @@ -import ebdd from '../../src/ebdd'; -import { EMPTY_OBJ } from './utils'; -import { ok, strictEqual } from 'assert'; -import Mocha, { Suite, interfaces } from 'mocha'; -import type { MochaGlobals } from 'mocha'; -import { createSandbox } from 'sinon'; -import type { SinonSandbox, SinonSpy } from 'sinon'; +import ebdd from '../../src/ebdd'; +import { EMPTY_OBJ } from './utils'; +import { ok, strictEqual } from 'assert'; +import Mocha, { type MochaGlobals, Suite, interfaces } from 'mocha'; +import { type SinonSandbox, type SinonSpy, createSandbox } from 'sinon'; describe ( diff --git a/test/spec/main.spec.ts b/test/spec/main.spec.ts index abafad8..ef2ade7 100644 --- a/test/spec/main.spec.ts +++ b/test/spec/main.spec.ts @@ -1,7 +1,6 @@ -import ebdd from '../../src/ebdd'; -import { strictEqual, throws } from 'assert'; -import postrequire from 'postrequire'; -import type { PostrequireStubs } from 'postrequire'; +import ebdd from '../../src/ebdd'; +import { strictEqual, throws } from 'assert'; +import postrequire, { type PostrequireStubs } from 'postrequire'; function requireMain(stubs?: Readonly>): unknown { diff --git a/test/spec/utils.ts b/test/spec/utils.ts index 4625e63..d8244b3 100644 --- a/test/spec/utils.ts +++ b/test/spec/utils.ts @@ -1,7 +1,6 @@ -import ebdd from '../../src/ebdd'; -import Mocha, { interfaces } from 'mocha'; -import type { MochaGlobals } from 'mocha'; -import type { SinonStub } from 'sinon'; +import ebdd from '../../src/ebdd'; +import Mocha, { type MochaGlobals, interfaces } from 'mocha'; +import type { SinonStub } from 'sinon'; export const EMPTY_OBJ = Object.create(null) as Record;