Skip to content

Commit

Permalink
fix: get rid of imports from build
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowusr committed Sep 2, 2024
1 parent 526dd31 commit 9f7174c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Recommended config:
}
```

Now you will be able to write Testplane tests using typescript.
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
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,25 @@ export type { Config } from "./config";
export type { ConfigInput } from "./config/types";
export type { TestCollection } from "./test-collection";

import type { TestDefinition, SuiteDefinition, TestHookDefinition } from "./test-reader/test-object/types";

declare global {
// eslint-disable-next-line no-var
/* eslint-disable no-var */
// Here, we ignore clashes of types between Mocha and Testplane, because in production we don't include @types/mocha,
// but we need mocha types in development, so this is an issue only during development.
///@ts-expect-error: see explanation above
var it: TestDefinition;
// @ts-expect-error: see explanation above
var describe: SuiteDefinition;
// @ts-expect-error: see explanation above
var beforeEach: TestHookDefinition;
// @ts-expect-error: see explanation above
var afterEach: TestHookDefinition;

var testplane: GlobalHelper;
/**
* @deprecated Use `testplane` instead
*/
// eslint-disable-next-line no-var
var hermione: GlobalHelper;
/* eslint-enable no-var */
}
8 changes: 0 additions & 8 deletions typings/api.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion typings/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/triple-slash-reference*/
/// <reference path="./api.d.ts" />
/// <reference path="./clear-require.d.ts" />
/// <reference path="./escape-string-regexp.d.ts" />
/* eslint-enable @typescript-eslint/triple-slash-reference */
Expand Down

0 comments on commit 9f7174c

Please sign in to comment.