Skip to content

Commit

Permalink
fix: make typescript compile without skipLibCheck in strict mode (#995)
Browse files Browse the repository at this point in the history
* refactor: re-write more parts of testplane to typescript

* chore: fix development watch mode

* fix: fix command history types, include all fields available and rename types
  • Loading branch information
Kabir-Ivan authored Sep 2, 2024
1 parent 1c88bef commit 7273cf0
Show file tree
Hide file tree
Showing 94 changed files with 1,637 additions and 1,228 deletions.
23 changes: 21 additions & 2 deletions docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ npm i -D ts-node

And include Testplane types in your `tsconfig.json` file:

```js
```json
// tsconfig.json
{
// other tsconfig options
Expand All @@ -23,7 +23,26 @@ And include Testplane types in your `tsconfig.json` file:
}
```

Now you will be able to write Testplane tests using typescript.
Recommended config:

```json
{
"compilerOptions": {
"types": [
"testplane"
],
"sourceMap": true,
"outDir": "../test-dist",
"target": "ESNext",
"module": "CommonJS",
"strict": true,
"lib": ["esnext", "dom"],
"esModuleInterop": true
}
}
```

Note: this is the strictest possible setting, which works on Typescript 5.3+. If you want faster type-checks or have older Typescript version, use `"skipLibCheck": true` in `compilerOptions`.

### testplane.ctx typings

Expand Down
120 changes: 99 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@
"license": "MIT",
"dependencies": {
"@babel/code-frame": "7.24.2",
"@gemini-testing/commander": "2.15.3",
"@gemini-testing/commander": "2.15.4",
"@jspm/core": "2.0.1",
"@types/mocha": "10.0.1",
"@types/debug": "4.1.12",
"@types/yallist": "4.0.4",
"@wdio/globals": "8.39.0",
"@wdio/protocols": "8.38.0",
"@wdio/types": "8.39.0",
Expand All @@ -76,7 +77,7 @@
"import-meta-resolve": "4.0.0",
"local-pkg": "0.4.3",
"lodash": "4.17.21",
"looks-same": "9.0.0",
"looks-same": "9.0.1",
"micromatch": "4.0.5",
"mocha": "10.2.0",
"plugins-loader": "1.3.3",
Expand Down Expand Up @@ -113,9 +114,12 @@
"@types/browserify": "12.0.40",
"@types/chai": "4.3.4",
"@types/chai-as-promised": "7.1.5",
"@types/debug": "4.1.12",
"@types/clear-require": "3.2.1",
"@types/escape-string-regexp": "2.0.1",
"@types/fs-extra": "11.0.4",
"@types/lodash": "4.14.191",
"@types/micromatch": "4.0.9",
"@types/mocha": "10.0.1",
"@types/node": "18.19.3",
"@types/proxyquire": "1.3.28",
"@types/sharp": "0.31.1",
Expand Down
Loading

0 comments on commit 7273cf0

Please sign in to comment.