-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update continuous integration configurations
- Loading branch information
Showing
10 changed files
with
536 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,7 @@ indent_size = 4 | |
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[package.json] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- 8 | ||
- 10 | ||
- 12 | ||
sudo: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '{build}' | ||
|
||
environment: | ||
matrix: | ||
- nodejs_version: 8 | ||
- nodejs_version: 10 | ||
- nodejs_version: 12 | ||
|
||
platform: | ||
- x64 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
- npm install | ||
|
||
cache: '%AppData%/npm-cache' | ||
|
||
build: off | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link href="lib/qunit-1.17.1.css" rel="stylesheet" type="text/css" /> | ||
<script src="lib/qunit-1.17.1.js"></script> | ||
<!--We only include jQuery for testing purposes (testing UI changes)--> | ||
<script src="lib/jquery-2.1.3.js"></script> | ||
<script src="lib/knockout-3.4.2.js"></script> | ||
<script src="../dist/knockout.validation.js"></script> | ||
|
||
<script src="../localization/ar-JO.js"></script> | ||
<script src="../localization/bg-BG.js"></script> | ||
<script src="../localization/ca-ES.js"></script> | ||
<script src="../localization/cs-CZ.js"></script> | ||
<script src="../localization/da-DK.js"></script> | ||
<script src="../localization/de-DE.js"></script> | ||
<script src="../localization/el-GR.js"></script> | ||
<script src="../localization/en-US.js"></script> | ||
<script src="../localization/es-ES.js"></script> | ||
<script src="../localization/fa-IR.js"></script> | ||
<script src="../localization/fr-FR.js"></script> | ||
<script src="../localization/he-IL.js"></script> | ||
<script src="../localization/hr-HR.js"></script> | ||
<script src="../localization/hu-HU.js"></script> | ||
<script src="../localization/it-IT.js"></script> | ||
<script src="../localization/ja-JP.js"></script> | ||
<script src="../localization/ko-KR.js"></script> | ||
<script src="../localization/lv-LV.js"></script> | ||
<script src="../localization/nb-NO.js"></script> | ||
<script src="../localization/nl-BE.js"></script> | ||
<script src="../localization/nl-NL.js"></script> | ||
<script src="../localization/pl-PL.js"></script> | ||
<script src="../localization/pt-BR.js"></script> | ||
<script src="../localization/pt-PT.js"></script> | ||
<script src="../localization/ro-RO.js"></script> | ||
<script src="../localization/ru-RU.js"></script> | ||
<script src="../localization/sv-SE.js"></script> | ||
<script src="../localization/tr-TR.js"></script> | ||
<script src="../localization/zh-CN.js"></script> | ||
<script src="../localization/zh-TW.js"></script> | ||
|
||
<!--test Scripts here--> | ||
<script src="asserts.js"></script> | ||
<script src="validation-tests.js"></script> | ||
<script src="validation-ui-tests.js"></script> | ||
<script src="utils-tests.js"></script> | ||
<script src="api-tests.js"></script> | ||
<script src="rules-tests.js"></script> | ||
<script src="locale-tests.js"></script> | ||
|
||
<title>Knockout JS Validation Tests (KnockoutJS v3.4.2)</title> | ||
<style type="text/css"> | ||
label { display: block; } | ||
.validationMessage { color: Red; } | ||
.customMessage { color: Orange; } | ||
</style> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="testContainer"></div> | ||
<div id="workbench"> | ||
<script> | ||
var captcha = function (val) { | ||
return val == 11; | ||
}; | ||
|
||
var mustEqual = function (val, other) { | ||
return val == other; | ||
}; | ||
|
||
var viewModel = { | ||
firstName: ko.observable().extend({ minLength: 2, maxLength: 10 }), | ||
lastName: ko.observable().extend({ required: { message: 'lastName is required' } }), | ||
emailAddress: ko.observable().extend({ // custom message | ||
required: { message: 'Please supply your email address.' } | ||
}), | ||
age: ko.observable().extend({ min: 1, max: 100 }), | ||
location: ko.observable(), | ||
subscriptionOptions: ['Technology', 'Music'], | ||
subscription: ko.observable().extend({ required: { message: 'subscription is required' } }), | ||
password: ko.observable(), | ||
captcha: ko.observable().extend({ // custom Anonymous validator | ||
validation: { validator: captcha, message: 'Please check.' } | ||
}), | ||
submit: function () { | ||
if (viewModel.errors().length == 0) { | ||
alert('Thank you.'); | ||
} else { | ||
alert('Please check your submission.'); | ||
viewModel.errors.showAllMessages(); | ||
} | ||
} | ||
}; | ||
|
||
viewModel.confirmPassword = ko.observable().extend({ | ||
required: true, | ||
validation: { validator: mustEqual, message: 'Passwords do not match.', params: viewModel.password } | ||
}); | ||
|
||
viewModel.errors = ko.validation.group(viewModel); | ||
|
||
viewModel.requireLocation = function () { | ||
viewModel.location.extend({ required: { message: 'location is required' } }); | ||
}; | ||
</script> | ||
<script id="customMessageTemplate" type="text/html"> | ||
<em class="customMessage" data-bind='validationMessage: field'></em> | ||
</script> | ||
<fieldset> | ||
<legend>User: <span id="errorCount" data-bind='text: errors().length'></span> errors</legend> | ||
<label>First name: <input id="firstNameTxt" data-bind='value: firstName'/></label> | ||
<label>Last name: <input id="lastNameTxt" data-bind='value: lastName'/></label> | ||
<div data-bind='validationOptions: { messageTemplate: "customMessageTemplate" }'> | ||
<label>Email: <input id="emailAddressTxt" data-bind='value: emailAddress' required pattern="@"/></label> | ||
<label>Location: <input id="locationTxt" data-bind='value: location'/></label> | ||
<label>Age: <input id="testAgeInput" data-bind='value: age' required/></label> | ||
</div> | ||
<label> | ||
Subscriptions: | ||
<select data-bind='value: subscription, options: subscriptionOptions, optionsCaption: "Choose one..."'></select> | ||
</label> | ||
<label>Password: <input data-bind='value: password' type="password"/></label> | ||
<label>Retype password: <input data-bind='value: confirmPassword' type="password"/></label> | ||
<label>10 + 1 = <input data-bind='value: captcha'/></label> | ||
</fieldset> | ||
<button type="button" data-bind='click: submit'>Submit</button> | ||
<br /> | ||
<br /> | ||
<button type="button" data-bind='click: requireLocation'>Make 'Location' required</button> | ||
<script> | ||
$(function() { | ||
ko.applyBindings(viewModel, $('#workbench')[0]); | ||
|
||
QUnit.module('Workbench Tests'); | ||
|
||
QUnit.test('Reports Correct Amount of Starting Errors', function(assert) { | ||
var cnt = $('#errorCount').text(); | ||
assert.strictEqual(cnt, '5', 'Init was not called, and the correct number of errors was evaluated'); | ||
}); | ||
}); | ||
</script> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link href="lib/qunit-1.17.1.css" rel="stylesheet" type="text/css" /> | ||
<script src="lib/qunit-1.17.1.js"></script> | ||
<!--We only include jQuery for testing purposes (testing UI changes)--> | ||
<script src="lib/jquery-2.1.3.js"></script> | ||
<script src="lib/knockout-3.5.0.js"></script> | ||
<script src="../dist/knockout.validation.js"></script> | ||
|
||
<script src="../localization/ar-JO.js"></script> | ||
<script src="../localization/bg-BG.js"></script> | ||
<script src="../localization/ca-ES.js"></script> | ||
<script src="../localization/cs-CZ.js"></script> | ||
<script src="../localization/da-DK.js"></script> | ||
<script src="../localization/de-DE.js"></script> | ||
<script src="../localization/el-GR.js"></script> | ||
<script src="../localization/en-US.js"></script> | ||
<script src="../localization/es-ES.js"></script> | ||
<script src="../localization/fa-IR.js"></script> | ||
<script src="../localization/fr-FR.js"></script> | ||
<script src="../localization/he-IL.js"></script> | ||
<script src="../localization/hr-HR.js"></script> | ||
<script src="../localization/hu-HU.js"></script> | ||
<script src="../localization/it-IT.js"></script> | ||
<script src="../localization/ja-JP.js"></script> | ||
<script src="../localization/ko-KR.js"></script> | ||
<script src="../localization/lv-LV.js"></script> | ||
<script src="../localization/nb-NO.js"></script> | ||
<script src="../localization/nl-BE.js"></script> | ||
<script src="../localization/nl-NL.js"></script> | ||
<script src="../localization/pl-PL.js"></script> | ||
<script src="../localization/pt-BR.js"></script> | ||
<script src="../localization/pt-PT.js"></script> | ||
<script src="../localization/ro-RO.js"></script> | ||
<script src="../localization/ru-RU.js"></script> | ||
<script src="../localization/sv-SE.js"></script> | ||
<script src="../localization/tr-TR.js"></script> | ||
<script src="../localization/zh-CN.js"></script> | ||
<script src="../localization/zh-TW.js"></script> | ||
|
||
<!--test Scripts here--> | ||
<script src="asserts.js"></script> | ||
<script src="validation-tests.js"></script> | ||
<script src="validation-ui-tests.js"></script> | ||
<script src="utils-tests.js"></script> | ||
<script src="api-tests.js"></script> | ||
<script src="rules-tests.js"></script> | ||
<script src="locale-tests.js"></script> | ||
|
||
<title>Knockout JS Validation Tests (KnockoutJS v3.5.0)</title> | ||
<style type="text/css"> | ||
label { display: block; } | ||
.validationMessage { color: Red; } | ||
.customMessage { color: Orange; } | ||
</style> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="testContainer"></div> | ||
<div id="workbench"> | ||
<script> | ||
var captcha = function (val) { | ||
return val == 11; | ||
}; | ||
|
||
var mustEqual = function (val, other) { | ||
return val == other; | ||
}; | ||
|
||
var viewModel = { | ||
firstName: ko.observable().extend({ minLength: 2, maxLength: 10 }), | ||
lastName: ko.observable().extend({ required: { message: 'lastName is required' } }), | ||
emailAddress: ko.observable().extend({ // custom message | ||
required: { message: 'Please supply your email address.' } | ||
}), | ||
age: ko.observable().extend({ min: 1, max: 100 }), | ||
location: ko.observable(), | ||
subscriptionOptions: ['Technology', 'Music'], | ||
subscription: ko.observable().extend({ required: { message: 'subscription is required' } }), | ||
password: ko.observable(), | ||
captcha: ko.observable().extend({ // custom Anonymous validator | ||
validation: { validator: captcha, message: 'Please check.' } | ||
}), | ||
submit: function () { | ||
if (viewModel.errors().length == 0) { | ||
alert('Thank you.'); | ||
} else { | ||
alert('Please check your submission.'); | ||
viewModel.errors.showAllMessages(); | ||
} | ||
} | ||
}; | ||
|
||
viewModel.confirmPassword = ko.observable().extend({ | ||
required: true, | ||
validation: { validator: mustEqual, message: 'Passwords do not match.', params: viewModel.password } | ||
}); | ||
|
||
viewModel.errors = ko.validation.group(viewModel); | ||
|
||
viewModel.requireLocation = function () { | ||
viewModel.location.extend({ required: { message: 'location is required' } }); | ||
}; | ||
</script> | ||
<script id="customMessageTemplate" type="text/html"> | ||
<em class="customMessage" data-bind='validationMessage: field'></em> | ||
</script> | ||
<fieldset> | ||
<legend>User: <span id="errorCount" data-bind='text: errors().length'></span> errors</legend> | ||
<label>First name: <input id="firstNameTxt" data-bind='value: firstName'/></label> | ||
<label>Last name: <input id="lastNameTxt" data-bind='value: lastName'/></label> | ||
<div data-bind='validationOptions: { messageTemplate: "customMessageTemplate" }'> | ||
<label>Email: <input id="emailAddressTxt" data-bind='value: emailAddress' required pattern="@"/></label> | ||
<label>Location: <input id="locationTxt" data-bind='value: location'/></label> | ||
<label>Age: <input id="testAgeInput" data-bind='value: age' required/></label> | ||
</div> | ||
<label> | ||
Subscriptions: | ||
<select data-bind='value: subscription, options: subscriptionOptions, optionsCaption: "Choose one..."'></select> | ||
</label> | ||
<label>Password: <input data-bind='value: password' type="password"/></label> | ||
<label>Retype password: <input data-bind='value: confirmPassword' type="password"/></label> | ||
<label>10 + 1 = <input data-bind='value: captcha'/></label> | ||
</fieldset> | ||
<button type="button" data-bind='click: submit'>Submit</button> | ||
<br /> | ||
<br /> | ||
<button type="button" data-bind='click: requireLocation'>Make 'Location' required</button> | ||
<script> | ||
$(function() { | ||
ko.applyBindings(viewModel, $('#workbench')[0]); | ||
|
||
QUnit.module('Workbench Tests'); | ||
|
||
QUnit.test('Reports Correct Amount of Starting Errors', function(assert) { | ||
var cnt = $('#errorCount').text(); | ||
assert.strictEqual(cnt, '5', 'Init was not called, and the correct number of errors was evaluated'); | ||
}); | ||
}); | ||
</script> | ||
</div> | ||
</body> | ||
</html> |