Skip to content

Commit 342af3b

Browse files
Copilotkobenguyent
andcommitted
Initial investigation of custom helper type definition issue
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent bf494fe commit 342af3b

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const config = {
2+
tests: './*_test.js',
3+
output: './output',
4+
helpers: {
5+
FileSystem: {},
6+
MyHelper: {
7+
require: './myhelper_helper.js',
8+
},
9+
},
10+
include: {},
11+
bootstrap: false,
12+
mocha: {},
13+
name: 'custom-helper-esm',
14+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Helper from '../../../../../lib/helper.js';
2+
3+
class MyHelper extends Helper {
4+
openPage(url) {
5+
return this.helpers.FileSystem.amInPath(url);
6+
}
7+
}
8+
9+
export default MyHelper;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// <reference types='codeceptjs' />
2+
type MyHelper = import('./myhelper_helper.js');
3+
4+
declare namespace CodeceptJS {
5+
interface SupportObject { I: I, current: any }
6+
interface Methods extends FileSystem, MyHelper {}
7+
interface I extends WithTranslation<Methods> {}
8+
namespace Translation {
9+
interface Actions {}
10+
}
11+
}

0 commit comments

Comments
 (0)