Skip to content

Commit 235119c

Browse files
Merge pull request #49 from express-rate-limit/meta/update-testing
Meta/update testing
2 parents a7fc8da + 288e81d commit 235119c

9 files changed

Lines changed: 1479 additions & 2218 deletions

.mocharc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"extension": ["ts"],
3-
"loader": "ts-node/esm",
43
"spec": "test/**/*.spec.ts",
54
"recursive": true
65
}

package-lock.json

Lines changed: 1150 additions & 1643 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
}
2626
},
2727
"scripts": {
28-
"test": "ts-mocha src/**/*.spec.ts",
28+
"test": "ts-mocha",
2929
"clean": "rm -rf ./dist",
3030
"build": "npm run clean && pkgroll --src source/ && cp source/migrations/ dist/ -r && npm run mjs-fix-prepend",
3131
"lint": "prettier --check .",
3232
"lint-autofix": "prettier --write .",
3333
"prepack": "npm run build",
3434
"prepare": "husky install",
35-
"generate-dev-licenses": "./node_modules/license-checker-rseidelsohn/bin/license-checker-rseidelsohn --limitAttributes licenses,repository,publisher,email --json --development > third_party_licenses/dev_detailed.json && ./node_modules/license-checker-rseidelsohn/bin/license-checker-rseidelsohn --summary --development > third_party_licenses/dev_summary.txt",
36-
"generate-production-licenses": "./node_modules/license-checker-rseidelsohn/bin/license-checker-rseidelsohn --limitAttributes licenses,repository,publisher,email --json --production > third_party_licenses/production_detailed.json && ./node_modules/license-checker-rseidelsohn/bin/license-checker-rseidelsohn --summary --production > third_party_licenses/production_summary.txt",
35+
"generate-dev-licenses": "license-checker-rseidelsohn --limitAttributes licenses,repository,publisher,email --json --development > third_party_licenses/dev_detailed.json && license-checker-rseidelsohn --summary --development > third_party_licenses/dev_summary.txt",
36+
"generate-production-licenses": "license-checker-rseidelsohn --limitAttributes licenses,repository,publisher,email --json --production > third_party_licenses/production_detailed.json && license-checker-rseidelsohn --summary --production > third_party_licenses/production_summary.txt",
3737
"generate-licenses": "npm run generate-dev-licenses && npm run generate-production-licenses",
3838
"mjs-fix-prepend": "printf '%s\\n%s\\n' \"import { dirname } from 'path'\nimport { fileURLToPath } from 'url';\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\" \"$(cat dist/index.mjs)\" > dist/index.mjs"
3939
},
@@ -72,22 +72,26 @@
7272
"@express-rate-limit/prettier": "1.1.1",
7373
"@express-rate-limit/tsconfig": "1.0.2",
7474
"@types/chai": "4.3.6",
75-
"@types/express": "4.17.17",
76-
"@types/mocha": "10.0.1",
77-
"@types/sinon": "10.0.16",
78-
"chai": "4.3.8",
79-
"express-rate-limit": "7.4.0",
80-
"global-jsdom": "9.2.0",
75+
"@types/express": "5.0.6",
76+
"@types/mocha": "10.0.10",
77+
"@types/sinon": "21.0.0",
78+
"chai": "4.5.0",
79+
"ts-mocha": "^11.1.0",
80+
"express-rate-limit": "8.3.0",
81+
"global-jsdom": "29.0.0",
8182
"husky": "8.0.3",
82-
"license-checker-rseidelsohn": "4.2.7",
83-
"lint-staged": "15.2.10",
83+
"license-checker-rseidelsohn": "4.4.2",
84+
"lint-staged": "16.4.0",
8485
"mocha": "11.7.5",
85-
"pkgroll": "2.12.1",
86-
"prettier": "3.0.3",
87-
"sinon": "16.0.0",
88-
"ts-mocha": "11.1.0",
89-
"ts-node": "10.9.1",
90-
"typescript": "5.2.2"
86+
"pkgroll": "2.27.0",
87+
"prettier": "3.8.1",
88+
"sinon": "21.0.3",
89+
"ts-node": "10.9.2",
90+
"typescript": "5.9.3"
91+
},
92+
"overrides": {
93+
"serialize-javascript": "^7.0.4",
94+
"diff": "^8.0.3"
9195
},
9296
"prettier": "@express-rate-limit/prettier",
9397
"lint-staged": {

test/stores/store_aggregated_ip.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { assert } from 'chai'
44
import { Pool } from 'pg'
55
import sinon, { SinonMock, SinonStub } from 'sinon'
66
import { PostgresStore } from '../../source'
7-
const migration_handler = require('../../source/util/migration_handler')
7+
import * as migration_handler from '../../source/util/migration_handler'
88

99
class ClientMock {
1010
query() {}

test/stores/store_individual_ip.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { assert } from 'chai'
44
import { Pool } from 'pg'
55
import sinon, { SinonMock, SinonStub } from 'sinon'
66
import { PostgresStoreIndividualIP } from '../../source'
7-
const migration_handler = require('../../source/util/migration_handler')
7+
import * as migration_handler from '../../source/util/migration_handler'
88

99
class ClientMock {
1010
query() {}

0 commit comments

Comments
 (0)