-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create test command #1
Changes from 15 commits
9e8b4ed
a4c042c
3957028
e35235b
1f60128
f066ede
c84c3ac
2298656
5274c59
6d7a03f
dd659e1
9244306
4550eb7
6cdf27d
4ab0441
1cc8225
fb5c440
4a386b3
14b9197
7ccfc39
8f32841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.js.map | ||
!/*.js | ||
!/tasks/*.js | ||
/_build | ||
/bower_components | ||
/dist | ||
/html-report | ||
/node_modules | ||
/typings | ||
.baseDir.ts | ||
.tscache | ||
coverage-unmapped.json | ||
npm-debug.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '6' | ||
env: | ||
global: | ||
- SAUCE_USERNAME: dojo2-ts-ci | ||
- SAUCE_ACCESS_KEY: e92610e3-834e-4bec-a3b5-6f7b9d874601 | ||
install: | ||
- travis_retry npm install grunt cli | ||
- travis_retry npm install | ||
script: | ||
- grunt | ||
- grunt intern:node --combined | ||
- grunt remapIstanbul:ci | ||
- grunt uploadCoverage | ||
notifications: | ||
slack: | ||
secure: O9m3cCkl3H8VXRIuKLFfx91C01n9yLlehem9K3snnBMiyrtGWR2aXo+t1eeZYGfFWIl8UBEaSPlDurI1KspIcW/JbszuYAVje21rbl+ptkp008f5gDVfFCFpqdM9S5+lrVJLlx1mrikWKBRsjYqZHYV9EJx/ss+P86JsQ0utC7zgBFYId+UCMybAemzi1FPfeULFWpoi8QavoN8fNr4yHBayrqOlqnnIhlYLoTiGL6yY8L/meUrmWVxSY3JMDxLeIYNppt4puvTGUD1hU2LZgFZp1y6jGMcAlZI5amGV+iyTl/h2w1wiB6q5tolJ1JslosFvh53y7+1Crbm8wQDkX42+z7Rn3/jXRUBFwLZBGZQ99FcE0Yz+XBaQA3GuCgPNd0rcHmJxeYAKMm7jg2B8Nzd6It3q5mjdp9ITA5kR2G7g+iH8R4y112FXCpvt4/RUvHuyhl7w8lFlHK+LslH3DBjDi3fKUuwiGtU8oD3xpCunJ4JUgQmAWIOy3mpFIOX4QPcBKqByp10fNw3G73JDsJ9DXrFGb/+WnA2OgpDnKOnjoporwufRZLeioRwCJAWM0DbFDvRc1mbnECwcKiedzKdTxSWUGyJ6sxKydZtC11tF356BkzIsf3x7cKSed2LI8VXYNiPOJu9P+/s5/jRf/7kZ+i2ETfuKZC2awhgkBGo= | ||
on_success: change |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = function (grunt) { | ||
var staticFiles = [ 'intern/**' ]; | ||
require('grunt-dojo2').initConfig(grunt, { | ||
ts: { | ||
dist: { | ||
exclude: [ | ||
'./src/intern', | ||
'./tests/**/*.ts' | ||
] | ||
} | ||
}, | ||
copy: { | ||
staticDistFiles: { | ||
expand: true, | ||
cwd: 'src', | ||
src: staticFiles, | ||
dest: '<%= distDirectory %>' | ||
}, | ||
staticDevFiles: { | ||
expand: true, | ||
cwd: 'src', | ||
src: staticFiles, | ||
dest: '<%= devDirectory %>/src' | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('ci', [ | ||
'intern:node' | ||
]); | ||
|
||
grunt.registerTask('dist', grunt.config.get('distTasks').concat(['copy:staticDistFiles'])); | ||
grunt.registerTask('dev', grunt.config.get('devTasks').concat(['copy:staticDevFiles'])); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
The "New" BSD License | ||
********************* | ||
|
||
Copyright (c) 2015 - 2017, The JS Foundation | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name of the Dojo Foundation nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# cli-test-intern | ||
The Dojo 2 cli command for testing applications | ||
|
||
<!-- TODO: change and uncomment | ||
[![Build Status](https://travis-ci.org/dojo/cli-test-intern.svg?branch=master)](https://travis-ci.org/dojo/cli-test-intern) | ||
[![codecov](https://codecov.io/gh/dojo/cli-test-intern/branch/master/graph/badge.svg)](https://codecov.io/gh/dojo/cli-test-intern) | ||
[![npm version](https://badge.fury.io/js/dojo-cli-test-intern.svg)](http://badge.fury.io/js/dojo-cli-test-intern) | ||
--> | ||
|
||
The official Dojo 2 test command. | ||
|
||
## Features | ||
|
||
TODO: Add sections on features of this package | ||
|
||
## How do I use this package? | ||
|
||
TODO: Add appropriate usage and instruction guidelines | ||
|
||
## How do I contribute? | ||
|
||
We appreciate your interest! Please see the [Dojo 2 Meta Repository](https://github.com/dojo/meta#readme) for the | ||
Contributing Guidelines and Style Guide. | ||
|
||
## Testing | ||
|
||
Test cases MUST be written using [Intern](https://theintern.github.io) using the Object test interface and Assert assertion interface. | ||
|
||
90% branch coverage MUST be provided for all code submitted to this repository, as reported by Istanbul’s combined coverage results for all supported platforms. | ||
|
||
To test locally in node run: | ||
|
||
`grunt test` | ||
|
||
## Licensing information | ||
|
||
* [ora](https://github.com/sindresorhus/ora) ([MIT](https://opensource.org/licenses/MIT)) | ||
* [Chalk](https://github.com/chalk/chalk)([MIT](https://opensource.org/licenses/MIT)) | ||
* [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn)([MIT](https://opensource.org/licenses/MIT)) | ||
* [pkg-dir](https://github.com/sindresorhus/pkg-dir)([MIT](https://opensource.org/licenses/MIT)) | ||
* [Istanbul](https://github.com/gotwarlost/istanbul)([New BSD](http://opensource.org/licenses/BSD-3-Clause)) | ||
* [Mockery](https://github.com/mfncooper/mockery)([MIT](https://opensource.org/licenses/MIT)) | ||
* [codecov.io](https://github.com/cainus/codecov.io)([MIT](https://opensource.org/licenses/MIT)) | ||
* [Glob](https://github.com/isaacs/node-glob)([ISC](https://opensource.org/licenses/ISC)) | ||
* [grunt-tslint](https://github.com/palantir/grunt-tslint)([Apache 2.0](https://opensource.org/licenses/Apache-2.0)) | ||
* [Sinon.JS](https://github.com/sinonjs/sinon)([New BSD](http://opensource.org/licenses/BSD-3-Clause)) | ||
* [TSLint](https://github.com/palantir/tslint)([Apache 2.0](https://opensource.org/licenses/Apache-2.0)) | ||
* [yargs](https://github.com/yargs/yargs)([MIT](https://opensource.org/licenses/MIT)) | ||
|
||
© 2004–2017 JS Foundation & contributors. [New BSD](LICENSE) license. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
comment: | ||
branches: | ||
- master | ||
- feature/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "dojo-cli-test-intern", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"version": "2.0.0-pre", | ||
"description": "Test a Dojo 2 application", | ||
"private": true, | ||
"homepage": "http://dojotoolkit.org", | ||
"bugs": { | ||
"url": "https://github.com/dojo/cli-test-intern/issues" | ||
}, | ||
"license": "BSD-3-Clause", | ||
"main": "main.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/dojo/cli-test-intern.git" | ||
}, | ||
"scripts": { | ||
"test": "grunt test" | ||
}, | ||
"devDependencies": { | ||
"@types/chalk": "^0.4.31", | ||
"codecov.io": "0.1.6", | ||
"@dojo/cli": "2.0.0-alpha.8", | ||
"@dojo/loader": "2.0.0-beta.9", | ||
"dts-generator": "~1.7.0", | ||
"glob": "^7.0.3", | ||
"grunt": "~1.0.1", | ||
"grunt-tslint": "^3.0.0", | ||
"grunt-dojo2": "2.0.0-beta.23", | ||
"intern": "~3.4.2", | ||
"istanbul": "^0.4.3", | ||
"mockery": "^1.7.0", | ||
"remap-istanbul": "^0.6.4", | ||
"sinon": "^1.17.5", | ||
"tslint": "^3.15.1", | ||
"typescript": "~2.1.4", | ||
"yargs": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"ora": "^0.3.0", | ||
"chalk": "^1.1.3", | ||
"cross-spawn": "^4.0.0", | ||
"pkg-dir": "^1.0.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default __dirname; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
define([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file seems to mix tabs and spaces |
||
'./intern' | ||
], function (intern) { | ||
intern.tunnel = 'SeleniumTunnel'; | ||
intern.tunnelOptions = { | ||
hostname: 'localhost', | ||
port: '4444' | ||
}; | ||
|
||
intern.environments = [ | ||
{ browserName: 'chrome' } | ||
]; | ||
|
||
return intern; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
define([ | ||
'./intern' | ||
], function (intern) { | ||
|
||
intern.capabilities = { | ||
project: '<%- appName %>', | ||
name: '<%- appName %>', | ||
fixSessionCapabilities: false | ||
}; | ||
|
||
intern.environments = [ | ||
{ browserName: 'internet explorer', version: [ '10.0', '11.0' ], platform: 'Windows 7' }, | ||
// { browserName: 'microsoftedge', platform: 'Windows 10' }, | ||
{ browserName: 'firefox', version: '49', platform: 'Windows 10' }, | ||
{ browserName: 'chrome', platform: 'Windows 10' }, | ||
// { browserName: 'safari', version: '9', platform: 'OS X 10.11' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. worth just removing the commented out platforms? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dylans requested I put in more commented out platforms as examples. I can see the usefulness of having some examples commented out so you can add some more browsers without having to go check saucelabs for the format. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but these configs are hidden from the consumer, so I'm not sure what benefit this will have. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a really good point. I'll remove them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
// { browserName: 'chrome', version: '54.0', platform: 'macOS 10.12' }, | ||
// { browserName: 'firefox', version: '49.0', platform: 'macOS 10.12' }, | ||
// { browserName: 'android', platform: 'Linux', version: '4.4', deviceName: 'Google Nexus 7 HD Emulator' }// , | ||
// { browserName: 'opera', version: '12.15', platform: 'Linux' }, | ||
// { browserName: 'chrome', version: '48.0', platform: 'Linux' }, | ||
// { browserName: 'iphone', version: '9.1', deviceName: 'iPhone 6' }, | ||
]; | ||
|
||
/* SauceLabs supports more max concurrency */ | ||
intern.maxConcurrency = 4; | ||
|
||
/* SauceLabs combined with Travis often causes functional tests to fail with too short a timeout */ | ||
intern.defaultTimeout = 10000; | ||
|
||
intern.tunnel = 'SauceLabsTunnel'; | ||
|
||
return intern; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
define([ | ||
'./intern' | ||
], function (intern) { | ||
|
||
intern.capabilities = { | ||
project: '<%- appName %>', | ||
name: '<%- appName %>' | ||
}; | ||
|
||
intern.environments = [ | ||
{ browserName: 'internet explorer', version: [ '10', '11' ], platform: 'WIN8' }, | ||
// { browserName: 'microsoftedge', platform: 'WIN10' }, | ||
{ browserName: 'firefox', version: '49', platform: 'WIN10' }, | ||
{ browserName: 'chrome', platform: 'WIN10' }, | ||
// { browserName: 'safari', version: '9', platform: 'CAPITAN' }, | ||
// { browserName: 'chrome', version: '55', platform: 'SIERRA' }, | ||
// { browserName: 'browser', platform: 'ANDROID', version: '6.0', deviceName: 'Galaxy S6', platformName: 'Android' }// , | ||
// { browserName: 'safari', platform: 'CAPITAN', version: '9.3', deviceName: 'iPhone 6s Plus', platformName: 'iOS' } | ||
]; | ||
|
||
/* Testingbot supports more max concurrency */ | ||
intern.maxConcurrency = 3; | ||
intern.tunnel = 'TestingBotTunnel'; | ||
intern.webdriver = { | ||
host: 'http://hub.testingbot.com/wd/hub', | ||
username: 'key', | ||
accessKey: 'secret' | ||
}; | ||
|
||
intern.tunnelOptions = { | ||
verbose: true, | ||
apiKey: 'key', | ||
apiSecret: 'secret' | ||
}; | ||
intern.useSauceConnect = false; | ||
|
||
return intern; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
define({ | ||
proxyPort: 9000, | ||
|
||
// A fully qualified URL to the Intern proxy | ||
proxyUrl: 'http://localhost:9000/', | ||
|
||
// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the | ||
// specified browser environments in the `environments` array below as well. See | ||
// https://code.google.com/p/selenium/wiki/DesiredCapabilities for standard Selenium capabilities and | ||
// https://saucelabs.com/docs/additional-config#desired-capabilities for Sauce Labs capabilities. | ||
// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment | ||
// automatically | ||
capabilities: { | ||
'browserstack.debug': false, | ||
project: '<%- appName %>', | ||
name: '<%- appName %>', | ||
fixSessionCapabilities: false | ||
}, | ||
|
||
// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce | ||
// OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other | ||
// capabilities options specified for an environment will be copied as-is | ||
environments: [ | ||
{ browserName: 'internet explorer', version: [ '10', '11' ], platform: 'WINDOWS' }, | ||
{ browserName: 'firefox', platform: 'WINDOWS' }, | ||
{ browserName: 'chrome', platform: 'WINDOWS' }/*, | ||
{ browserName: 'Safari', version: '9', platform: 'OS X' }*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a few more examples should be commented out, e.g other browsers for Mac or Linux? |
||
], | ||
|
||
// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service | ||
maxConcurrency: 2, | ||
|
||
// Name of the tunnel class to use for WebDriver tests | ||
tunnel: 'BrowserStackTunnel', | ||
|
||
// Support running unit tests from a web server that isn't the intern proxy | ||
initialBaseUrl: (function () { | ||
if (typeof location !== 'undefined' && location.pathname.indexOf('__intern/') > -1) { | ||
return '/'; | ||
} | ||
return null; | ||
})(), | ||
|
||
// The desired AMD loader to use when running unit tests (client.html/client.js). Omit to use the default Dojo | ||
// loader | ||
loaders: { | ||
'host-browser': 'node_modules/@dojo/loader/loader.js', | ||
'host-node': '@dojo/loader' | ||
}, | ||
|
||
// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader | ||
// can be used here | ||
loaderOptions: { | ||
// Packages that should be registered with the loader in each testing environment | ||
packages: [ | ||
{ name: 'src', location: '_build/src' }, | ||
{ name: 'tests', location: '_build/tests' }, | ||
{ name: 'dojo', location: 'node_modules/intern/browser_modules/dojo' }, | ||
{ name: 'sinon', location: 'node_modules/sinon/pkg', main: 'sinon' }, | ||
{ name: '@dojo', location: 'node_modules/@dojo' } | ||
] | ||
}, | ||
|
||
// Non-functional test suite(s) to run in each browser | ||
suites: [ 'tests/unit/all' ], | ||
|
||
// Functional test suite(s) to run in each browser once non-functional tests are completed | ||
functionalSuites: [ 'tests/functional/all' ], | ||
|
||
// A regular expression matching URLs to files that should not be included in code coverage analysis | ||
excludeInstrumentation: /(?:node_modules|bower_components|tests)[\/]/, | ||
|
||
defaultTimeout: 5000 | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we could fill out the readme a bit?