I've added some testing for firefoxos in plugman, but am a bit stuck on the uninstall handler.

test:
        describe('of <source-file> elements', function() {
it('should remove stuff by calling common.removeFile', function(done) {
                var s = spyOn(common, 'removeFile');

                install('firefoxos', temp, dummyplugin, plugins_dir, {})
                .then(function() {
                    var source = copyArray(valid_source);
                    firefoxos['source-file'].uninstall(source[0], temp);
expect(s).toHaveBeenCalledWith(temp, path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
                    done();
                 });
            });
        });


result:

1) firefoxos project handler uninstallation of <source-file> elements should remove stuff by calling common.removeFile
   Message:
     timeout: timed out after 5000 msec waiting for spec to complete
   Stacktrace:
     undefined

The install never completes. (the 'then' part is never reached)

What is the way to go here? commit the test, and leave fixin it to the 'code owner'? Or are only non-failing tests allowed?

I'd rather fix it myself, and did give it a try, but got a bit lost in the install module.
so, some questions:
 - how is e.g.
require('../plugman').emit('verbose', 'Install complete for ' + plugin_id + ' on ' + platform + '.'); controled? can i set the emit level and where can i find it's output? Can it be used running tests (npm test)?
 - is there a howto on using the nodejs debugger in npm


Gert-Jan Braas


Steven Gill schreef op 2014-02-19 18:18:
Do it!
On Feb 19, 2014 3:27 AM, "Gert-Jan Braas" <br...@steckelfisch.nl> wrote:

I noticed there are no unit test for firefoxos yet.

Is anybody working on that?

Mayebe thats a nice thing to pick up for me.

Gert-Jan Braas

--
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/


--
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/

Reply via email to