Skip to content

Commit

Permalink
feat(datepicker): added custom date parse logic for manual date input (
Browse files Browse the repository at this point in the history
…#3271)

fixes #3206
fixes #3104 
fixes #2809
  • Loading branch information
valorkin authored Jan 11, 2018
1 parent 321f9ae commit 4f5fc18
Show file tree
Hide file tree
Showing 171 changed files with 20,980 additions and 2,356 deletions.
2 changes: 1 addition & 1 deletion .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
],
"test": {
"karma": {
"config": "karma.conf.js"
"config": "karma-demo.conf.js"
}
},
"defaults": {
Expand Down
161 changes: 161 additions & 0 deletions karma-demo.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;

module.exports = function (config) {
const configuration = {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
require('karma-sauce-launcher')
],
files: [
{pattern: './scripts/test.ts', watched: false}
],
preprocessors: {
'./scripts/test.ts': ['@angular/cli']
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['dots', 'coverage-istanbul']
: ['dots', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
browserNoActivityTimeout: 20000,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 5000,
singleRun: false,
customLaunchers: {
Chrome_travis_ci: {
base: 'ChromeHeadless',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222'
]
}
},
mime: {'text/x-typescript': ['ts', 'tsx']},
client: {captureConsole: true, clearContext: false}
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}

if (process.env.SAUCE) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
process.exit(1);
}

configuration.plugins.push(require('karma-sauce-launcher'));
Object.assign(configuration, {
logLevel: config.LOG_INFO,
reporters: ['dots', 'saucelabs'],
singleRun: false,
concurrency: 2,
captureTimeout: 60000,
sauceLabs: {
testName: 'ngx-bootstrap',
build: process.env.TRAVIS_JOB_NUMBER,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
retryLimit: 5,
startConnect: false,
recordVideo: false,
recordScreenshots: false,
options: {
'command-timeout': 600,
'idle-timeout': 600,
'max-duration': 5400
}
},
customLaunchers: {
'SL_CHROME': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest'
},
'SL_CHROME_1': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest-1'
},
'SL_FIREFOX': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest'
},
'SL_FIREFOX_1': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest-1'
},
'SL_IE10': {
base: 'SauceLabs',
browserName: 'internet explorer',
// platform: 'Windows 2012',
version: '10'
},
'SL_IE11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11.0'
},
'SL_EDGE13': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13'
},
'SL_EDGE14': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '14'
},
'SL_EDGE15': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '15'
},
'SL_SAFARI9': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '9.0'
},
'SL_SAFARI10': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '10.0'
}
}
});


configuration.browsers = Object.keys(configuration.customLaunchers);
}

config.set(configuration);
};
168 changes: 14 additions & 154 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,161 +1,21 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

const customLaunchers = require('./scripts/sauce-browsers').customLaunchers;

module.exports = function (config) {
const configuration = {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
require('karma-sauce-launcher')
],
module.exports = function(config) {
config.set({
frameworks: ["jasmine", "karma-typescript"],
files: [
{pattern: './scripts/test.ts', watched: false}
{ pattern: "src/bs-moment/**/*.+(ts|html)" }
],
preprocessors: {
'./scripts/test.ts': ['@angular/cli']
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
"**/*.ts": "karma-typescript"
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['dots', 'coverage-istanbul']
: ['dots', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browserNoActivityTimeout: 20000,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 5000,
singleRun: false,
customLaunchers: {
Chrome_travis_ci: {
base: 'ChromeHeadless',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222'
]
}
},
mime: {'text/x-typescript': ['ts', 'tsx']},
client: {captureConsole: true, clearContext: false}
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}

if (process.env.SAUCE) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');
process.exit(1);
}

configuration.plugins.push(require('karma-sauce-launcher'));
Object.assign(configuration, {
logLevel: config.LOG_INFO,
reporters: ['dots', 'saucelabs'],
singleRun: false,
concurrency: 2,
captureTimeout: 60000,
sauceLabs: {
testName: 'ngx-bootstrap',
build: process.env.TRAVIS_JOB_NUMBER,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
retryLimit: 5,
startConnect: false,
recordVideo: false,
recordScreenshots: false,
options: {
'command-timeout': 600,
'idle-timeout': 600,
'max-duration': 5400
}
reporters: ["progress", "karma-typescript"],
browsers: ["ChromeHeadless"],
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/
},
customLaunchers: {
'SL_CHROME': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest'
},
'SL_CHROME_1': {
base: 'SauceLabs',
browserName: 'chrome',
version: 'latest-1'
},
'SL_FIREFOX': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest'
},
'SL_FIREFOX_1': {
base: 'SauceLabs',
browserName: 'firefox',
version: 'latest-1'
},
'SL_IE10': {
base: 'SauceLabs',
browserName: 'internet explorer',
// platform: 'Windows 2012',
version: '10'
},
'SL_IE11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11.0'
},
'SL_EDGE13': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '13'
},
'SL_EDGE14': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '14'
},
'SL_EDGE15': {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: '15'
},
'SL_SAFARI9': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '9.0'
},
'SL_SAFARI10': {
base: 'SauceLabs',
browserName: 'safari',
// platform: 'OS X 10.11',
version: '10.0'
}
compilerOptions: {
lib: ["ES2015", "DOM"]
}
});


configuration.browsers = Object.keys(configuration.customLaunchers);
}

config.set(configuration);
}
});
};
2 changes: 2 additions & 0 deletions mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--compilers ts:ts-node/register
src/bs-moment/**/*.spec.ts
Loading

0 comments on commit 4f5fc18

Please sign in to comment.