craigburke / karma-gradle

Gradle Plugin for Running tests with Karma
Other
21 stars 11 forks source link

How to serve fixtures using file patterns? #27

Closed arjunkumar-udainath closed 7 years ago

arjunkumar-udainath commented 7 years ago

Hi, Thank you for building this fantastic plugin! I've been trying out this in a project and I've managed to include JS files necessary, but not fixtures.

This is what my "files" setting in my.conf.js for karma looks like: // list of files / patterns to load in the browser files: [ 'js/tests/lib/jquery.js', 'js/tests/spec/javascripts/helpers/jasmine-jquery.js', 'js/modules/initFixtures.js', 'js/modules/module.js', 'js/tests/spec/javascripts/default-spec.js', { pattern: 'js/tests/spec/javascripts/fixtures/index.html', included: false, served: true, watched:true } ],

How do I replicate the same in my build.gradle file? I need to serve the HTML file as a fixture and if I include it like other JS files int the list, the tests don't work they should. My tests run when I directly call karma, but not when I run from gradle.

arjunkumar-udainath commented 7 years ago

Update: I figured out that we could create custom JSON objects using the JsonSlurper class. Nevermind.