add support to typescript

This commit is contained in:
GleidsonDaniel 2022-04-28 16:33:51 -03:00
parent 3eff53c707
commit 08615d25dd
5 changed files with 1770 additions and 493 deletions

View File

@ -1,12 +1,4 @@
module.exports = { module.exports = {
presets: [ presets: ['@babel/preset-env'],
[ plugins: [['@babel/transform-runtime']]
'@babel/preset-env',
{
targets: {
node: '14'
}
}
]
]
}; };

View File

@ -119,7 +119,7 @@ exports.config = {
ui: 'bdd', ui: 'bdd',
timeout: 60000 timeout: 60000
}, },
specs: ['./tests/specs/**/*.js'] specs: ['./tests/specs/**/*.js'],
// beforeSuite() { // beforeSuite() {
// const { setup } = require('../../e2e/helpers/data_setup'); // const { setup } = require('../../e2e/helpers/data_setup');
@ -127,4 +127,18 @@ exports.config = {
// await setup(); // await setup();
// }); // });
// } // }
autoCompileOpts: {
autoCompile: true,
// see https://github.com/TypeStrong/ts-node#cli-and-programmatic-options
// for all available options
tsNodeOpts: {
transpileOnly: true,
project: 'tsconfig.json'
},
// tsconfig-paths is only used if "tsConfigPathsOpts" are provided, if you
// do please make sure "tsconfig-paths" is installed as dependency
tsConfigPathsOpts: {
baseUrl: './'
}
}
}; };

View File

@ -10,6 +10,9 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.9",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/register": "^7.17.7", "@babel/register": "^7.17.7",
"@wdio/appium-service": "^7.19.1", "@wdio/appium-service": "^7.19.1",
"@wdio/cli": "^7.19.3", "@wdio/cli": "^7.19.3",
@ -18,6 +21,8 @@
"@wdio/spec-reporter": "^7.19.1", "@wdio/spec-reporter": "^7.19.1",
"@wdio/sync": "^7.19.3", "@wdio/sync": "^7.19.3",
"chai": "^4.3.6", "chai": "^4.3.6",
"ts-node": "^10.7.0",
"typescript": "^4.6.2",
"wdio-json-reporter": "^3.0.0", "wdio-json-reporter": "^3.0.0",
"webdriverio": "^7.19.3" "webdriverio": "^7.19.3"
} }

13
appium/tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"outDir": "./.tsbuild/",
"sourceMap": false,
"target": "es2019",
"module": "commonjs",
"removeComments": true,
"noImplicitAny": true,
"strictPropertyInitialization": true,
"strictNullChecks": true,
"types": ["node", "webdriverio/async", "@wdio/mocha-framework"]
}
}

File diff suppressed because it is too large Load Diff