Skip to content

Commit 774fd62

Browse files
Merge pull request #4982 from swagger-api/test/swg-1570--run-tests-in-ts
test: run tests in typescript
2 parents aebc500 + 7bcbda0 commit 774fd62

File tree

414 files changed

+315
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+315
-503
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
run: |
8989
npm run prebuild
9090
npm run build:es
91+
- name: Build typescript declarations
92+
run: npm run typescript:declaration
9193
- name: Execute tests in monorepo
9294
run: npm run test
9395

package-lock.json

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

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
"ts-node": "=10.9.2",
100100
"typescript": "=5.5.4",
101101
"webpack": "=5.99.9",
102-
"webpack-cli": "=6.0.1"
102+
"webpack-cli": "=6.0.1",
103+
"@types/expect": "^1.20.4",
104+
"ts-mocha": "^11.1.0",
105+
"tsconfig-paths": "^4.2.0"
103106
}
104107
}

packages/apidom-ast/.mocharc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2-
"recursive": true,
3-
"spec": "test/**/*.mjs"
2+
"extensions": ["ts"],
3+
"spec": ["test/**/*.ts"],
4+
"loader": "ts-node/esm",
5+
"recursive": true
46
}

packages/apidom-ast/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
2424
"lint": "eslint ./",
2525
"lint:fix": "eslint ./ --fix",
26-
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
27-
"test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
26+
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
27+
"test": "NODE_ENV=test ts-mocha",
2828
"typescript:check-types": "tsc --noEmit",
2929
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
3030
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2+
"extensions": ["ts"],
3+
"loader": "ts-node/esm",
24
"recursive": true,
3-
"spec": "test/**/*.mjs",
4-
"file": ["test/mocha-bootstrap.mjs"]
5+
"spec": "test/**/*.ts",
6+
"file": ["test/mocha-bootstrap.ts"]
57
}

packages/apidom-converter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
2424
"lint": "eslint ./",
2525
"lint:fix": "eslint ./ --fix",
26-
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
26+
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' ./dist ./types",
2727
"typescript:check-types": "tsc --noEmit && tsc -p ./test/tsconfig.json --noEmit",
2828
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
29-
"test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
29+
"test": "NODE_ENV=test ts-mocha",
3030
"test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 mocha",
3131
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
3232
"postpack": "rimraf NOTICE LICENSES"

0 commit comments

Comments
 (0)