Upgrade Gulp to v4 (#6809)

This commit is contained in:
Niels Lyngsø
2019-10-23 10:31:07 +02:00
committed by Sebastiaan Janssen
parent 01ddc97e25
commit cc3ef9de0c
23 changed files with 2923 additions and 3018 deletions

View File

@@ -13,7 +13,7 @@ var app = angular.module('umbraco', [
'ngSanitize',
//'ngMessages',
'tmh.dynamicLocale',
'tmh.dynamicLocale'
//'ngFileUpload',
//'LocalStorageModule',
//'chart.js'

View File

@@ -51,9 +51,23 @@ module.exports = function (config) {
exclude: [],
// use dolts reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress', 'junit', 'teamcity'
// possible values: 'dots', 'progress', 'junit', 'spec'
// ***
// progress: Outputs a simple list like: "Executed 128 of 144 SUCCESS (0 secs / 0.814 secs)"
// spec: Outputs a more verbose report which is more useful for debugging if one of the tests fails.
// ***
// CLI --reporters progress
reporters: ['progress', 'junit'],
reporters: ['spec', 'junit'],
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: true, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: false, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: false // print the time elapsed for each spec
},
// web server port
// CLI --port 9876
@@ -102,7 +116,9 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-phantomjs-launcher'),
require('karma-junit-reporter')
require('karma-junit-reporter'),
require('karma-spec-reporter')
],
// the default configuration

View File

@@ -37,7 +37,7 @@ describe('Drop down controller tests', function () {
$routeParams: routeParams
});
//this should be the expected format based on the changes made to the sortable prevalues
// this should be the expected format based on the changes made to the sortable prevalues
expect(scope.model.config.items[0].value).toBe("value0");
expect(scope.model.config.items[1].value).toBe("value1");
expect(scope.model.config.items[2].value).toBe("value2");

View File

@@ -0,0 +1,69 @@
(function () {
describe('truncate filter', function() {
var $truncate;
var testCases = [
{input:'test', noOfChars:5, appendDots:true, expectedResult: 'test'},
{input:'test ', noOfChars:4, appendDots:true, expectedResult: 'test…'},
{input:'test a long text with space', noOfChars:5, appendDots:true, expectedResult: 'test …'},
{input:'scenarios is a long word', noOfChars:5, appendDots:true, expectedResult: 'scena…'},
{input:'scenarios is a long word', noOfChars:10, appendDots:true, expectedResult: 'scenarios …'},
{input:'test', noOfChars:5, appendDots:false, expectedResult: 'test'},
{input:'test a long text with space', noOfChars:5, appendDots:false, expectedResult: 'test '},
{input:'scenarios is a long word', noOfChars:5, appendDots:false, expectedResult: 'scena'},
{input:'scenarios is a long word', noOfChars:10, appendDots:false, expectedResult: 'scenarios '}
];
var testCasesNew = [
{value:'test', wordwise:false, max:20, tail:'...', expectedResult: 'test'},
{value:'LoremIpsumLoremIpsumLoremIpsum',wordwise:false, max:20, tail:null, expectedResult: 'LoremIpsumLoremIpsum…'}
];
beforeEach(module('umbraco'));
beforeEach(inject(function($filter) {
$truncate = $filter('truncate');
}));
it('empty string as input is expected to give an empty string', function() {
expect($truncate('', 5, true)).toBe('');
});
it('null as input is expected to give an empty string', function() {
expect($truncate(null, 5, true)).toBe('');
});
it('undefined as input is expected to give an empty string', function() {
expect($truncate(undefined, 5, true)).toBe('');
});
it('null as noOfChars to result in \'test\'', function() {
expect($truncate('test', null, true)).toBe('test');
});
it('undefined as noOfChars to result in \'test\'', function() {
expect($truncate('test', undefined, true)).toBe('test');
});
it('null as appendDots to behave as false', function() {
expect($truncate('test', 5, null)).toBe('test');
});
testCases.forEach(function(test){
it('Expects \'' + test.input + '\' to be truncated as \''+ test.expectedResult + '\', when noOfChars=' + test.noOfChars + ', and appendDots=' + test.appendDots, function() {
console.log($truncate(test.input, test.noOfChars, test.appendDots));
expect($truncate(test.input, test.noOfChars, test.appendDots)).toBe(test.expectedResult);
});
});
testCasesNew.forEach(function(test){
it('Expects \'' + test.value + '\' to be truncated as \''+ test.expectedResult + '\', when wordwise=' + test.wordwise + ', and max=' + test.max + ', and tail=' + test.tail, function() {
expect($truncate(test.value, test.wordwise, test.max, test.tail)).toBe(test.expectedResult);
});
});
});
}());