在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):craigburke/karma-gradle开源软件地址(OpenSource Url):https://github.com/craigburke/karma-gradle开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):Karma Gradle PluginThis Gradle plugin allows you to run Jasmine, Qunit, or Mocha tests using the Karma test runner. Getting Startedplugins {
id 'com.craigburke.karma' version '1.4.4'
} TasksThe plugin adds the following tasks to your build:
ConfigurationPropertiesYou can use the same properties you’d set in your karma.config.js file directly in build.gradle plugins {
id 'com.craigburke.karma' version '1.4.4'
}
karma {
basePath = 'src/assets' // <1>
colors = true // <2>
profile 'angularJS' // <3>
browsers = ['PhantomJS'] // <4>
frameworks = ['jasmine'] // <5>
reporters = ['junit'] // <6>
}
ProfilesProfiles allow you to use commonly used file patterns and sensible defaults for the files list. Currently there is a plugins {
id 'com.craigburke.karma' version '1.4.4'
}
karma {
profile 'angularJS' // <1>
}
For any profile, the files to be loaded are broken into three groups (libraries, source and tests). You can override the base path and file pattern list for any of these groups within a profile. This can be useful if the order that the files are loaded in matters. karma {
profile('default') {
libraryBases = ['**/libs/']
libraryFiles = ['jquery.js', 'lib1.js'] // <1>
sourceBases = ['src/', 'app/']
sourceFiles = ['source1.js', '**/*.js'] // <2>
testBases = ['tests/']
testFiles = ['**/*test.js'] // <3>
}
}
DependenciesBy default the plugin will automatically install all needed browser, framework and reporter dependencies. If you need to add an additional npm dependency you can set it using the karma {
dependencies(['karma-sinon'])
} You can also lock any dependency to a specific version by adding it this way with @ version syntax: karma {
dependencies(['[email protected]'])
} Advanced ConfigurationIn addition to the properties listed above, you can also include set other Karma properties through the DSL. karma {
files = [
'bower/angular/angular.js',
'**/!(*.spec).js',
'**/*.spec.js'
]
exclude = ['jquery.js']
junitReporter = [outputDir: 'test-dir' ]
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论