Skip to content

Commit

Permalink
Update build and code style
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Oct 8, 2023
1 parent 1ce44c8 commit 1b5dab4
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 37 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"sinon": "9",
"ts-node": "latest",
"tslib": "2",
"typescript": "5.0"
"typescript": "5.2"
},
"peerDependencies": {
"@types/mocha": ">=7",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
14 changes: 7 additions & 7 deletions test/spec/ebdd-suite.spec.ts
Original file line number Diff line number Diff line change
@@ -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
(
Expand Down
24 changes: 18 additions & 6 deletions test/spec/ebdd-test.spec.ts
Original file line number Diff line number Diff line change
@@ -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
(
Expand Down
12 changes: 5 additions & 7 deletions test/spec/ebdd.spec.ts
Original file line number Diff line number Diff line change
@@ -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
(
Expand Down
7 changes: 3 additions & 4 deletions test/spec/main.spec.ts
Original file line number Diff line number Diff line change
@@ -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<Partial<PostrequireStubs>>): unknown
{
Expand Down
7 changes: 3 additions & 4 deletions test/spec/utils.ts
Original file line number Diff line number Diff line change
@@ -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<PropertyKey, any>;

Expand Down

0 comments on commit 1b5dab4

Please sign in to comment.