0
私はChromeからPhantomJSに切り替えると、私はここで、以下のerrorhAureliaでPhantomJSを使用するにはどうすればよいですか?
Starting 'unit'...
03 08 2016 21:39:43.629:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
03 08 2016 21:39:43.643:INFO [launcher]: Starting browser PhantomJS
03 08 2016 21:39:44.355:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket /#ns0iei_Fprf487aCAAAA with id 15517298
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
SyntaxError: Expected an identifier but found 'originalDefine' instead
at /home/xenoterracide/IdeaProjects/rpf-ui/test/aurelia-karma.js:49
{ uid: 0,
name: 'unit',
branch: false,
error: 1,
duration: [ 1, 91922852 ],
time: 1470278384500 }
1
を取得するには、オーレリアによって生成karma.conf.js
です。
"use strict";
const path = require('path');
const project = require('./aurelia_project/aurelia.json');
const tsconfig = require('./tsconfig.json');
let testSrc = [
{ pattern: project.unitTestRunner.source, included: false },
'test/aurelia-karma.js'
];
let output = project.platform.output;
let appSrc = project.build.bundles.map(x => path.join(output, x.name));
let entryIndex = appSrc.indexOf(path.join(output, project.build.loader.configTarget));
let entryBundle = appSrc.splice(entryIndex, 1)[0];
let files = [entryBundle].concat(testSrc).concat(appSrc);
module.exports = function(config) {
config.set({
basePath: '',
frameworks: [project.testFramework.id],
files: files,
exclude: [],
preprocessors: {
[project.unitTestRunner.source]: [project.transpiler.id]
},
typescriptPreprocessor: {
typescript: require('typescript'),
options: tsconfig.compilerOptions
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: false
});
};