-
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
Conversation
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.
Overall this looks really helpful, mostly just added various meta comments for things I noticed. I do wonder if we want to add support for some of the Intern 3.4 features (performance, a11y, and visual regression testing) as options, though that's probably best done via a separate issue?
[![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. |
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.
Dojo 2 (capitalization)
|
||
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. |
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.
Istanbul (capitalization)
|
||
* [Third-party lib one](https//github.com/foo/bar) ([New BSD](http://opensource.org/licenses/BSD-3-Clause)) | ||
|
||
© 2004–2016 Dojo Foundation & contributors. [New BSD](http://opensource.org/licenses/BSD-3-Clause) license. |
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.
Should now be JS Foundation. Should just link to our own LICENSE file probably.
The "New" BSD License | ||
********************* | ||
|
||
Copyright (c) 2015 - 2016, The Dojo Foundation |
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.
2017 and JS Foundation.
{ | ||
"name": "dojo-cli-test-intern", | ||
"version": "2.0.0-pre", | ||
"description": "test a dojo 2 application", |
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.
Test a Dojo 2 application
{ browserName: 'firefox', version: '43', platform: 'Windows 10' }, | ||
{ browserName: 'chrome', platform: 'Windows 10' }, | ||
// { browserName: 'safari', version: '9', platform: 'OS X 10.11' }, | ||
{ browserName: 'android', platform: 'Linux', version: '4.4', deviceName: 'Google Nexus 7 HD Emulator' }// , |
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.
Should we also be testing Chrome for Android separately?
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.
I commented this out actually because I don't believe the issue with android on saucelabs have been resolved yet.
{ 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 comment
The 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?
register(helper: Helper) { | ||
helper.yargs.option('c', { | ||
alias: 'config', | ||
describe: 'Specifies what configuration to test with: browserstack(default), \'saucelabs\', or \'local\'ly.', |
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.
could also be testingbot or crossbrowsertesting (though perhaps not since we don't include configs for those environments, but perhaps we should)?
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.
I added configuration for testingbot. It might be documented somewhere but I couldn't see how to set testingbot credentials via environment variables so I also added command line args to specify credentials, and added the same support for browserstack and saucelabs as well.
crossbrowsertesting is not supported by the version of dig dug and intern that the create app cli sets as the application's dependency so I'm thinking we should hold off on adding support for that here until it'll work.
@@ -0,0 +1,20 @@ | |||
{ | |||
"version": "2.0.3", |
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.
Any reason to not be 2.1.4?
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.
Nope, updated.
"declaration": false, | ||
"module": "umd", | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, |
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.
I think there are a couple of other noImplicit* statements we've started to use?
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.
I'm not sure. I think the last change was to add strictNullChecks
: https://github.com/dojo/widgets/blob/master/tsconfig.json#L4-L15. Although if there are more that I should add I can of course put those in.
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.
The others I'm thinking of are noUnusedParameters
and noUnusedLocals
, but I'm not sure if we've standardized on using those across the Dojo 2 packages? cc @agubler
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.
We are not using those because those are captured by linting.
define([ | ||
'./intern' | ||
], function (intern) { | ||
intern.tunnel = 'NullTunnel'; |
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.
do we want to potentially use the SeleniumTunnel
for local now?
@@ -0,0 +1,15 @@ | |||
define([ |
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.
this file seems to mix tabs and spaces
|
||
The official Dojo 2 test command. | ||
|
||
## Features |
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?
@@ -0,0 +1,44 @@ | |||
{ | |||
"name": "dojo-cli-test-intern", |
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.
@dojo/cli-test-intern
// { 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
run(helper: Helper, args: TestArgs) { | ||
return new Promise((resolve, reject) => { | ||
if (!helper.command.exists('build')) { | ||
reject(Error('Required command: \'build\', does not exist')); |
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 say, have you npm install @dojo/cli-build?
as part of the error?
register(helper: Helper) { | ||
helper.yargs.option('c', { | ||
alias: 'config', | ||
describe: 'Specifies what configuration to test with: browserstack(default), \'testingbot\', \'saucelabs\', or \'local\'ly.', |
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.
do you think that local
should be the default?
* Moved to scoped packages * Make local tests the default * Specify capabilities at run time so the project name can be read from package.json
@agubler With the changes merged into todoMVC here, and once these changes are merged into cli-build, this should work with todoMVC. All your other feedback that I didn't reply to directly should be addressed, and I've tested this with the above changes locally. Testing locally, in saucelabs, and in browserstack all work. One thing to note: if you try to run in saucelabs or browserstack you will see a lot of failures. That's an issue with todoMVC though, as its tests fail in Firefox and IE 10/11, whether they're run via |
Current coverage is 100% (diff: 100%)
|
Delegates to
cli-build
to build tests and then runs them usingintern-runner
.