Commit 01b66964 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Mike Greiling

Generate JUnit report for Karma tests

parent 9b076493
......@@ -78,3 +78,4 @@ eslint-report.html
/.gitlab_pages_secret
package-lock.json
/junit_rspec.xml
/junit_karma.xml
......@@ -743,6 +743,8 @@ karma:
paths:
- chrome_debug.log
- coverage-javascript/
reports:
junit: junit_karma.xml
code_quality:
<<: *dedicated-no-docs-no-db-pull-cache-job
......
......@@ -80,11 +80,12 @@ if (specFilters.length) {
module.exports = function(config) {
process.env.TZ = 'Etc/UTC';
const progressReporter = process.env.CI ? 'mocha' : 'progress';
const karmaConfig = {
basePath: ROOT_PATH,
browsers: ['ChromeHeadlessCustom'],
client: {
isCI: !!process.env.CI
},
customLaunchers: {
ChromeHeadlessCustom: {
base: 'ChromeHeadless',
......@@ -104,11 +105,19 @@ module.exports = function(config) {
preprocessors: {
'spec/javascripts/**/*.js': ['webpack', 'sourcemap'],
},
reporters: [progressReporter],
reporters: ['progress'],
webpack: webpackConfig,
webpackMiddleware: { stats: 'errors-only' },
};
if (process.env.CI) {
karmaConfig.reporters = ['mocha', 'junit'];
karmaConfig.junitReporter = {
outputFile: 'junit_karma.xml',
useBrowserName: false,
};
}
if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') {
karmaConfig.reporters.push('coverage-istanbul');
karmaConfig.coverageIstanbulReporter = {
......
......@@ -146,7 +146,7 @@ describe('GfmAutoComplete', function () {
shouldNotBeFollowedBy.forEach((followedSymbol) => {
const seq = atSign + followedSymbol;
it(`should not match "${seq}"`, () => {
it(`should not match ${JSON.stringify(seq)}`, () => {
expect(defaultMatcher(atwhoInstance, atSign, seq)).toBe(null);
});
});
......
/* eslint-disable
jasmine/no-global-setup, jasmine/no-unsafe-spy, no-underscore-dangle, no-console
*/
/* global __karma__ */
import $ from 'jquery';
import 'vendor/jasmine-jquery';
......@@ -41,8 +42,8 @@ jasmine.getJSONFixtures().fixturesPath = FIXTURES_PATH;
beforeAll(() => {
jasmine.addMatchers(
jasmineDiff(jasmine, {
colors: true,
inline: true,
colors: !__karma__.config.isCi,
inline: !__karma__.config.isCi,
}),
);
jasmine.addMatchers(customMatchers);
......
......@@ -4220,6 +4220,13 @@ karma-jasmine@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.2.tgz#394f2b25ffb4a644b9ada6f22d443e2fd08886c3"
karma-junit-reporter@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz#4f9c40cedfb1a395f8aef876abf96189917c6396"
dependencies:
path-is-absolute "^1.0.0"
xmlbuilder "8.2.2"
karma-mocha-reporter@^2.2.5:
version "2.2.5"
resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560"
......@@ -7139,6 +7146,10 @@ xdg-basedir@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4"
xmlbuilder@8.2.2:
version "8.2.2"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773"
xmlhttprequest-ssl@~1.5.4:
version "1.5.5"
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment