I have encountered an issue with a simple Typescript class:
export class Hello{
myname: string = 'Scott';
sayHello() {
console.log(this.myname);
}
}
In one of my Protractor Typescript files, I am trying to use it as follows:
import { Hello } from './hello';
const hello = new Hello();
hello.sayHello();
However, I am facing a Typescript compilation error:
[11:48:33] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript: projects/cxone-component-showcase/e2e/src/hello.ts(3,14): error TS2339: Property 'myname' does not exist on type 'Hello'. projects/cxone-component-showcase/e2e/src/hello.ts(6,26): error TS2339: Property 'myname' does not exist on type 'Hello'.
The same exact Typescript class works fine in the actual Angular app. Do I need to make changes to the tsconfig file for the e2e tests? The current configuration for e2e is:
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
If you have any insights or ideas, please let me know as this situation is frustrating me. Thank you.