업과 함께 몇 가지 테스트를 시도했지만 제대로 작동하지 못했습니다. 내 응용 프로그램과 함께 작동 시키려고 시도한 후에 가능한 가장 간단한 테스트로 실행하려고 시도했지만 여전히 완료되지 않았습니다. 여기 카르마 테스트가 끝나지 않았습니다
내 karma.conf.js 파일입니다// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files/patterns to load in the browser
files: [
// 'app/bower_components/angular/angular.js',
// // 'app/bower_components/angular/angular-mocks.js',
// 'app/scripts/*.js',
// 'app/scripts/controllers/main.js',
// // 'test/mock/**/*.js',
// 'test/spec/**/*.js',
// // 'app/scripts/**/*.js,'
'testing.js'
],
// list of files/patterns to exclude
exclude: ['angular-scenario.js'],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable/disable watching file and executing tests whenever any file changes
autoWatch: false,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
여기에 testing.js 파일입니다
describe("hello", function(){
it("Should fail automatically", function(){
expect(false).toBe(true)
});
});
내가 반드시 얻는 결과는 다음과 같습니다
$ karma start karma.conf.js
INFO [karma]: Karma v0.10.9 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Mac OS X 10.7.5)]: Connected on socket dGANukHhgkPC3YyhyUrU
INFO [Chrome 30.0.1599 (Mac OS X 10.7.5)]: Connected on socket HC8iGMv-VmeYX2UAyUrV
내 테스트가 얼마나 성공했는지 알 수 없다.
도움 주셔서 감사합니다. 잘만되면 나는 hahha의 끝에 약간의 머리를 놓고 갈 것이다.
이의 모든 결과가 나오면 Chrome이 테스트를 실행하지 않는 것 같습니다. 비슷한 문제에 직면했지만 어떻게 해결했는지 잊어 버렸습니다. 다른 브라우저를 사용해보십시오. 당신은 PhantomJS를 시험해보고 당신이 얻는 것을 보길 원할 것입니다. – yanhan