以编程方式传递业力

时间:2017-07-14 14:00:27

标签: jasmine karma-runner karma-jasmine

我正在使用带有jasmine的karma和jasmine-spec-tags框架。当从CLI启动业力时,我使用“karma start --tags = MY_TAG”来仅使用标签MY_TAG运行一些测试。这很好。

现在,我需要以编程方式开始业力。我尝试了以下代码(注意最后的client.args值):

const server = new Server(
{
    autoWatch: true,
    browsers: [
        'Chrome',
    ],
    files: [
        './node_modules/babel-polyfill/dist/polyfill.js',
        './node_modules/es6-shim/es6-shim.min.js',
        './karma/karma.entry.js'
    ],
    frameworks: ['jasmine', 'jasmine-spec-tags'],
    phantomJsLauncher: {
        exitOnResourceError: true
    },
    port: 9876,
    preprocessors: {
        './karma/karma.entry.js': ['webpack', 'sourcemap']
    },
    reporters: ['dots'],
    singleRun: false,
    webpack: webpackConf,
    webpackServer: {
        noInfo: true
    },
    client:
    {
        args: ['--tags=SchedulingApiService']
    }
});

server.start();

这不起作用。我误解了client.args价值吗?对任何帮助都会很高兴。

1 个答案:

答案 0 :(得分:0)

要解决此问题,client部分必须如下所示:

client:
{
    tags: 'SchedulingApiService'
}
相关问题