Skip to content

Commit

Permalink
added support for ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Jul 20, 2022
1 parent d9b8be1 commit 1222c03
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@
*/
const Nightwatch = require('../lib/index.js');
const {Logger, shouldReplaceStack, alwaysDisplayError} = require('../lib/utils');
const path = require('path');

try {
const projectTsFile = path.join(process.cwd(), 'nightwatch', 'tsconfig.json');
let projectTsExists = false;
try {
require(projectTsFile);
projectTsExists = true;

require('ts-node').register({
esm: false,
project: projectTsFile
});
} catch (err) {
// eslint-disable-line
}

Nightwatch.cli(function(argv) {
argv._source = argv['_'].slice(0);

Expand Down

0 comments on commit 1222c03

Please sign in to comment.