Allow other objects to be exported in test files. #284

wants to merge 2 commits into


None yet

1 participant


More flexible test files, for my test suite I wanted to export other objects from the same test file (module) and vows did not like that idea as it tries to run every object that is exported by the module as a test.

There are several other reasons why one would want to export from within the same file, ofc the main one is to keep the project structure clean. I could have split the files but going from 1 to 2/3 files is just cumbersome and a small change inside vows was easier to deal with.

Example test file:

var complexVar = {};
var complexTest = function () {};

vows.describe('The Good Things').addBatch({
    'A strawberry': {
        topic: new(Strawberry),
        'is red': function (strawberry) {
            var color = complextTest(strawberry);
            assert.equal (color, '#ff0000');

module.exports.var = complexVar;
module.exports.test = complexTest;

If I missed something and there is a cleaner way to do this already, feel free to point it out to me.

vowsjs member

👍 in principle, but we need to investigate this more and have tests.

@indexzero indexzero added the v0.9.0 label Nov 12, 2014
@indexzero indexzero added a commit that referenced this pull request Nov 22, 2014
@indexzero indexzero [api] Allow for multiple exports in required test files. Fixes #284 b…
…y manual merge of changes from @NemoPersona.
vowsjs member

Cherry-picking commits from a repo that has been deleted into a feature branch is basically impossible @NemoPersona, sorry I couldn't grab your commits explicltly, but I attributed you in the commit message in a5a124d

@indexzero indexzero closed this Nov 22, 2014
@indexzero indexzero referenced this pull request Nov 22, 2014

v0.9.0-rc1 #328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment