context.name is undefined when using 'buster-amd' for --reporter

20 views
Skip to first unread message

Mark Peterson

unread,
Aug 4, 2013, 1:33:42 AM8/4/13
to bust...@googlegroups.com
I'm encountering a problem when using 'buster-amd' with --reporter xml. Ultimately, the 'classname' is missing the name of the module being tested.

Deeper into the issue, this problem can be seen within path/to/buster-tests/libs/buster-tests/reporters/xml.js "contextStart" method (it gets called twice per module).

If you put a console.log(context.name) you'll get the following (within your xml)

1: Chrome 28.0.1500.95, Mac OS X 10.6.8
2: undefined

And this affects the 'classname' by printing 'classname="Chrome 28.0.1500.95, Mac OS X 10.6.8."' instead of 'classname="Chrome 28.0.1500.95, Mac OS X 10.6.8.Module name"'.

And ultimately, this makes the test results unusable on Jenkins CI.

This problem also affects --reporter html

Let me know what other information would be helpful. I'm debugging on my side too (trying to find where "context:start" is being called at the moment).

Thanks!



Mark Peterson

unread,
Aug 4, 2013, 1:38:12 AM8/4/13
to bust...@googlegroups.com
I should add that I really like Buster.JS so far for the nodejs + require.js + backbone.js projects that I'm working on.

Mark Peterson

unread,
Aug 4, 2013, 3:51:39 AM8/4/13
to bust...@googlegroups.com
This is an example of a test against the "Thing" model. Perhaps I have set things up wrong. However, the only thing that's not working is "classname" in the resulting xml from "--reporter xml" argument. So I'm guessing that I might not be entirely wrong, but perhaps just missing a callback.

buster.spec.expose();

describe('ThingModel', function(run) {
    // 'models' maps to 'src/js/models' within 'requirejs-config.js' ...
    require(['models/thing'], function(Thing) {
        run(function() {
            it('should load', function() {
                var thing = new Thing();
                    thing.set('test_name', 'test_value');
                expect(thing.get('test_name')).toEqual('test_value');
            });
           
        });
    });
});

As I said, everything works fine aside for the "classname".

Thanks!


On Sunday, August 4, 2013 1:33:42 AM UTC-4, Mark Peterson wrote:

Mark Peterson

unread,
Aug 5, 2013, 12:10:23 AM8/5/13
to bust...@googlegroups.com
The below works fine. I'm back in business!

define(['models/thing'], function(Thing) {

    buster.testCase('Thing model', {
   
        "should have setter and getter" : function() {

            var thing = new Thing();
                thing.set('test_name', 'test_value');
            expect(thing.get('test_name')).toEqual('test_value');
        }
    })
});
--
You received this message because you are subscribed to a topic in the Google Groups "Buster.JS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/busterjs/kB2QNWCvXaY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to busterjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages