saschakiefer / generator-openui5

yeoman generator for OpenUI5 applications and assets
Other
64 stars 17 forks source link

QUnit Test in Gruntfile configured incorrectly #46

Open saschakiefer opened 10 years ago

saschakiefer commented 10 years ago

The libTest section in the Gruntfile.js points to a directory which is not part of the scaffolding.

The watch:libTest task points to a jshint subtask which does not exist.

libTest seems to be an incorrect name anyways.

js1972 commented 10 years ago

I wondered what that directory was for... Thought you must have had plans for it.

On Fri, Feb 7, 2014 at 8:35 PM, saschakiefer notifications@github.com wrote:

The libTest section in the Gruntfile.js points to a directory which is not part of the scaffolding. The watch:libTest task points to a jshint subtask which does not exist. The qunit task is only exectuted once in the default task and when watching never again.

libTest seems to be an incorrect name anyways.

Reply to this email directly or view it on GitHub: https://github.com/saschakiefer/generator-openui5/issues/46

saschakiefer commented 10 years ago

Nope, not really. I think I copied from somewhere and it stuck in there. I didn't recognize it, since nobody used it so far. I'm currently adding tests to the project I'm working on (which I for sure generated with our generator) I also was wondering if we should add gunit to the bower dependencies...

I will take the changes I'm doing to my project back to the gruntfile.

js1972 commented 10 years ago

Gunit? http://en.m.wikipedia.org/wiki/G-Unit

On Fri, Feb 7, 2014 at 8:43 PM, saschakiefer notifications@github.com wrote:

Nope, not really. I think I copied from somewhere and it stuck in there. I didn't recognize it, since nobody used it so far. I'm currently adding tests to the project I'm working on (which I for sure generated with our generator) I also was wondering if we should add gunit to the bower dependencies...

I will take the changes I'm doing to my project back to the gruntfile.

Reply to this email directly or view it on GitHub: https://github.com/saschakiefer/generator-openui5/issues/46#issuecomment-34433489

saschakiefer commented 10 years ago

Changes in Gruntfile.js Completely remove jshint:libTest

replace watch:libTest with

qunit: {
    files: ["<%= jshint.application.src %>", "<%= qunit.all.src %>"],
    tasks: ["qunit"]
},

Maybe qunit:all should be changed to:

qunit: {
    all: {
        options: {
            urls: ["http://localhost:8888/url/to/Test.qunit.html"]
        }
    }
},

in that case "<%= qunit.all.src %>" needs to be replaced by "test/**/*.html" in watch:qunit

ToDo: Check what works best. When having files, phantom.js has trouble loading and instanciating the ui5 core. It works better, when there is a http request used. Issue: you don't want to add all URLs to all test cases in Gruntfile.js

Changes in package.json Add

"qunitjs": "~1.14.0"

to devDependencies when going for approach 2

saschakiefer commented 10 years ago

For now, I implemented solution, to fix the structure, but we should investigate option 2 a bit deeper, to make end to end testing easier.

saschakiefer commented 10 years ago

Marker to investigate option 2