Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Update tests to Intern 4 #356

Merged
merged 11 commits into from
Oct 16, 2017
Merged

Update tests to Intern 4 #356

merged 11 commits into from
Oct 16, 2017

Conversation

bryanforbes
Copy link
Member

Type: enhancement

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

This PR updates the unit and functional tests from Intern 3 to Intern 4

Resolves #347

intern.json Outdated
{ "browserName": "edge" },
{ "browserName": "firefox", "platform": "WINDOWS" },
{ "browserName": "chrome", "platform": "WINDOWS" }
// Issue with iphone 9.1 and Safari compatability, commented out for move to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments in a json file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it wonderful?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erm not especially, what is intern using to allow comments? Perhaps we should remove them.

Copy link
Member

@agubler agubler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some newbie questions a couple of which have already been answered :)

async function executeTest(suite: Suite, htmlTestPath: string, timeout = 10000) {
try {
return await suite.remote.get(htmlTestPath).then(pollUntil(function () {
return (<any> window).loaderTestResults || null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be better to use dojo/shim/global?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is always run on the client and it would be a big overhead to require() the shim for this simple polling function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it a big overhead to require a single module from shim?

Copy link
Member Author

@bryanforbes bryanforbes Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a functional test, the text of this function is sent to the client and run synchronously. There's no way to do a require(['@dojo/shim/global'], function () { ... }) in the execution on the client for a pollUntil.

assert.strictEqual(object.month, date.getMonth() + 1);
date.setMonth((object.month = 1) - 1);
assert.strictEqual(object.month, date.getMonth() + 1);
tests: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of the test wrapping object?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found out, that if there are lifecycle functions such as before then all tests need to be wrapped in a tests object.

import { Destroyable } from '../../src/Destroyable';

registerSuite({
name: 'bases/Destroyable',
registerSuite('bases/Destroyable', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need bases in the name now? Think this is a hangover from where they were moved from (compose)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'd like me to update this as part of the PR, just give me the word

Copy link
Member

@agubler agubler Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you're moving the name might be nice 👍

assert.strictEqual(map.get([ 1 ] ), 'foo');
assert.strictEqual(map.get([ 2 ] ), 'baz');
},
tests: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests wrapping object again?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore, answered here

registerSuite({
name: 'Evented',

registerSuite('Evented', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QueingEvented

@@ -1,6 +1,3 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove the file if there are no more typings required.

tsconfig.json Outdated
@@ -14,6 +14,12 @@
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitThis": true,
"plugins": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It loads a tslint plugin so linting errors come through in the language services. We're using it for Intern 4 and makes the development experience quite nice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. We should probably put an issue in meta if we want to add that to the Dojo 2 packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than include it in core as part of the intern 4 conversion.

@@ -9,6 +9,9 @@ module.exports = function (grunt) {
options: {
ignoreCompilerErrors: true, // Remove this once compile errors are resolved
}
},
intern: {
version: 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this anymore with your new grunt-dojo2 changes, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grunt-dojo2 still defaults to Intern 3 for backwards compatibility, so we need this

Copy link
Member

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments that were already raised.

@bryanforbes bryanforbes merged commit 208b419 into dojo:master Oct 16, 2017
@bryanforbes bryanforbes deleted the intern-4 branch October 16, 2017 15:34
@dylans dylans added this to the 2017.10 milestone Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants