I have Typescript package A where I create `export...
# typescript
l
I have Typescript package A where I create
export abstract class Network extends pulumi.ComponentResource
. In package B, depending on A, I create a concrete subclass
class GoogleNetwork extends network.Network
. In the same file where this concrete class is defined, I use it via
this.virtualNetwork = new GoogleNetwork(name)
. The build works, but when running tests, I get this error:
Copy code
TypeError: Class constructor Network cannot be invoked without 'new'
    at new GoogleNetwork (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/src/index.ts:21:23)
    at GoogleNetworkBuilder.network (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/src/index.ts:29:31)
    at Object.<anonymous> (/Users/ringods/Projects/cumundi/blueprints/libraries/packages/network-gcp/test/simple.ts:5:6)
    ...
This is probably something missing in my
tsconfig.json
files, but I failed to find what so far. I experimented with the following
compilerOptions
so far:
target
,
module
,
moduleResolution