03 Tsconfig.json - biswajitsundara/Protractor GitHub Wiki

  • The tsconfig.json file specifies the root files and the compiler options required to compile the project
  • Protractor can not understand typescript, it can understand only java script.
  • So we need to basically compile the type script code and generate the java script code.
  • When we add tsconfig.json file in the directory, the compiler treats it as type script project

How to create the file

Give command tsc --init this will add tsconfig.json file to project

Basic Configuration

  • "target": "es6", //This is the java script compiler version. ES6 is latest.
  • "outDir": "JSFiles" // After compiling type script files, in which folder to put JS files
  • "exclude": ["node_modules"] //exclude array will exclude those folders/files and won't convert to java script.

How to Compile

type command: tsc It will compile all type script files under this project and then generate java script files

How to run

type command: protractor JSFiles/conf.js This will run the converted conf file from JSFiles folder