티스토리 뷰
28 02 2019 03:11:04.528:ERROR [plugin]: Error during loading "D:\workspace\HyperCube\node_modules/karma-typescript" plugin:
Cannot find module 'typescript'
28 02 2019 03:11:04.649:ERROR [preprocess]: Can not load "karma-typescript", it is not registered!
Perhaps you are missing some plugin?
28 02 2019 03:11:04.654:ERROR [karma-server]: Server start failed on port 9876: Error: No provider for "framework:karma-typescript"! (Resolving: framework:karma-typescript)
npm ERR! Test failed. See above for more details.
Typescript 를 테스트하기 위해서, karma 와 mocha 를 사용하는 환경을 구성하고 테스트를 실행해보았는데 위와 같은 에러를 받았다.
나의 경우에 해결법은
karma-typescript 모듈을 global 하게 설치함으로써 solve 되었다.
npm install -g karma-typescript
karma.config.js
// Karma configuration
// Generated on Tue Feb 26 2019 21:17:12 GMT+0900 (GMT+09:00)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
plugins : [
'karma-typescript'
],
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'requirejs','chai','karma-typescript'],
// list of files / patterns to load in the browser
files: [
'test-main.js',
{pattern : 'test/**/*.ts',included:true},
{pattern : 'test/*.ts',included:false}
],
karmaTypescriptConfig : {
compilerOptions : {
module : "commonjs"
},
tsconfig : "./tsconfig.json",
},
// list of files / patterns to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.ts":"karma-typescript"
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress','karma-typescript'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
'프로그래밍 언어 > typescript' 카테고리의 다른 글
Karma 에서 node 와 requirejs 의 conflict (0) | 2019.02.28 |
---|
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- CMake run proto compiler
- 복습 계획어플
- 14714 플래너
- 14714 어플리케이션
- CMake get_filename_Component
- review reminder
- 14714 복습법
- CMAke 파일이름 추출
- function pointer overflow
- react-native
- 14714 어플
- CMake get file name
- 토리파 공부법
- CMake 강좌
- 14714 review
- CMake 기초
- 14714 공부법 어플리케이션
- CMake 반복문
- aws 청구문의
- 복습 어플
- 14714 공부법
- CMake probouf
- buffer-over-flow
- CMake for
- CMake for문
- 함수포인터 오버라이트
- CMake run protoc
- 14714 앱
- aws 프리티어 요금청구
- get_filename_component
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함