publishes js test results to xml so that Azure DevOps can read the results, re-enables js test building, fixes an issue with one of the tests

This commit is contained in:
Shannon
2019-02-14 12:30:36 +11:00
parent f814a80ab7
commit 5e38cadacc
6 changed files with 50 additions and 16 deletions
+1
View File
@@ -160,3 +160,4 @@ build/temp/
# eof
/src/Umbraco.Web.UI.Client/TESTS-*.xml
@@ -6,5 +6,5 @@ var runSequence = require('run-sequence');
// Build - build the files ready for production
gulp.task('build', function(cb) {
runSequence(["js", "dependencies", "less", "views"], /*"test:unit",*/ cb);
runSequence(["js", "dependencies", "less", "views"], "test:unit", cb);
});
+16
View File
@@ -8664,6 +8664,16 @@
"jasmine-core": "^3.3"
}
},
"karma-junit-reporter": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz",
"integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=",
"dev": true,
"requires": {
"path-is-absolute": "^1.0.0",
"xmlbuilder": "8.2.2"
}
},
"karma-phantomjs-launcher": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz",
@@ -16436,6 +16446,12 @@
"ultron": "~1.1.0"
}
},
"xmlbuilder": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz",
"integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=",
"dev": true
},
"xmlhttprequest-ssl": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
+4 -3
View File
@@ -48,6 +48,7 @@
"@babel/preset-env": "7.1.6",
"autoprefixer": "9.3.1",
"cssnano": "4.1.7",
"fs": "0.0.2",
"gulp": "^3.9.1",
"gulp-babel": "8.0.0",
"gulp-clean-css": "4.0.0",
@@ -58,6 +59,7 @@
"gulp-imagemin": "^4.1.0",
"gulp-less": "4.0.1",
"gulp-ngdocs": "0.3.0",
"gulp-notify": "^3.0.0",
"gulp-open": "3.0.1",
"gulp-postcss": "8.0.0",
"gulp-rename": "1.4.0",
@@ -65,16 +67,15 @@
"gulp-watch": "5.0.1",
"gulp-wrap": "0.14.0",
"gulp-wrap-js": "0.4.1",
"gulp-notify": "^3.0.0",
"jasmine-core": "3.3.0",
"karma": "3.1.1",
"karma-jasmine": "2.0.1",
"karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "1.0.4",
"less": "3.9.0",
"lodash": "4.17.11",
"marked": "^0.5.2",
"merge-stream": "1.0.1",
"run-sequence": "2.2.1",
"fs": "0.0.2"
"run-sequence": "2.2.1"
}
}
@@ -1,7 +1,7 @@
module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../..',
@@ -52,7 +52,7 @@ module.exports = function (config) {
// use dolts reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress', 'junit', 'teamcity'
// CLI --reporters progress
reporters: ['progress'],
reporters: ['progress', 'junit'],
// web server port
// CLI --port 9876
@@ -60,7 +60,7 @@ module.exports = function (config) {
// cli runner port
// CLI --runner-port 9100
runnerPort: 9100,
runnerPort: 9100,
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
@@ -89,7 +89,7 @@ module.exports = function (config) {
// allow waiting a bit longer, some machines require this
browserNoActivityTimeout: 100000, // default 10,000ms
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: true,
@@ -100,7 +100,19 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-phantomjs-launcher')
]
require('karma-phantomjs-launcher'),
require('karma-junit-reporter')
],
// the default configuration
junitReporter: {
outputDir: '', // results will be saved as $outputDir/$browserName.xml
outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile
suite: '', // suite will become the package name attribute in xml testsuite element
useBrowserName: true, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
}
});
};
@@ -52,11 +52,15 @@ describe('Content picker controller tests', function () {
describe('content edit controller save and publish', function () {
var item = {
name: "meh",
id: 666,
icon: "woop"
};
var item;
beforeEach(function () {
item = {
name: "meh",
id: 666,
icon: "woop"
};
});
it('should define the default properties on construction', function () {
expect(scope.model.value).not.toBeUndefined();
@@ -107,4 +111,4 @@ describe('Content picker controller tests', function () {
});
});
});
});