简体   繁体   中英

Karma throw 404 error for a derived controller class

I have just created a derived controller class (defined using type script) and using it in the parent controller class (type script class).

Everything seem to be right but Karma is not able to load this file. Throws 404 error.

Here is the error

Error: (SystemJS) XHR error (404 Not Found) loading Path/Controller.js
Error: XHR error (404 Not Found) loading Path/Controller.js
Error loading Path/Controller.js as ".Path/ParentClass.js

I have included the class in the parent class we well.

import 'Path/ChildClass';

The Error it throws in browser is as below.

Uncaught (in promise) TypeError: Cannot read property 'error' of undefined
at directCallParentKarmaMethod (context.js:233)
at ContextKarma.error (context.js:139)
at adapter.js:186

But if I just remove this import statement from the controller the Karma tests work fine.

I am guessing this is because the Controller being imported is a child/derived controller.

Is there a way I can fix this?

我很愚蠢,无法解决文件名中的大小写问题,但是我现在解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM