Skip to content

Commit

Permalink
Update configuration to process TypeScript without *.js output
Browse files Browse the repository at this point in the history
  • Loading branch information
gin committed Jul 9, 2020
1 parent 413e859 commit 4111e50
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"version": "0.0.1",
"description": "Demo of how I used webdriverio for Aaron",
"scripts": {
"test": "tsc && wdio run wdio.conf.js",
"clean": "rm -rf src"
"test": "wdio run wdio.conf.js"
},
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "src/",
"removeComments": true,
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"*": [ "./*" ]
},
"types": ["node", "@wdio/sync", "@wdio/mocha-framework", "@types/mocha"]
},
"include": [
Expand Down
20 changes: 17 additions & 3 deletions wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exports.config = {
runner: 'local',
specs: [
'./src/specs/*.js'
'./test/specs/*.ts'
],
exclude: [
],
Expand All @@ -15,7 +15,7 @@ exports.config = {
},
}],
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: 'info',
logLevel: 'warn',
// If you only want to run your tests until a specific amount of tests have failed use
// bail (default is 0 - don't bail, run all tests).
bail: 0,
Expand All @@ -29,8 +29,12 @@ exports.config = {
mochaOpts: {
// TypeScript setup
require: ['ts-node/register'],
// Optional
//require: ['tsconfig-paths/register'],
ui: 'bdd',
timeout: 60000
timeout: 60000,
// Optional
//compilers: ['tsconfig-paths/register'],
},
/**
* Gets executed once before all workers get launched.
Expand Down Expand Up @@ -67,6 +71,16 @@ exports.config = {
*/
// before: function (capabilities, specs) {
// },
before: function() {
// This is required
// Alternatively, put the `require:` line in `mochaOpts`:
// e.g.
//mochaOpts: {
// // TypeScript setup
// require: ['ts-node/register'],

//require('ts-node').register({ files: true });
},
/**
* Runs before a WebdriverIO command gets executed.
* @param {String} commandName hook command name
Expand Down

0 comments on commit 4111e50

Please sign in to comment.