Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent type. #1245

Closed
dino-su opened this issue Jun 20, 2014 · 2 comments
Closed

Inconsistent type. #1245

dino-su opened this issue Jun 20, 2014 · 2 comments

Comments

@dino-su
Copy link

dino-su commented Jun 20, 2014

Hi,

Given the type test below, the lib type isn't consistent between files. please see more detail at here: https://gist.github.com/dno/5a5190f888fa385ef61e

var Lib1   = require('./lib1.js');
var Lib2   = require('./lib2.js');
var Lib3   = require('./lib3.js');
var assert = require('assert');

describe('Type of', function() {
    'use strict';

    it('all should be function', function() {
        assert.equal(typeof(Lib1), 'function');
        assert.equal(typeof(Lib2), 'function');
        assert.equal(typeof(Lib3), 'function');
    });

    it('all should still be function in lib1', function() {
        var lib1 = new Lib1();
        assert.equal(lib1.lib2Type, 'function');
        assert.equal(lib1.lib3Type, 'function');
    });

    it('all should still be function in lib2', function() {
        var lib2 = new Lib2();
        assert.equal(lib2.lib1Type, 'function'); // fail
        assert.equal(lib2.lib3Type, 'function'); 
    });


    it('all should still be function in lib3', function() {
        var lib3 = new Lib3();
        assert.equal(lib3.lib1Type, 'function'); // fail
        assert.equal(lib3.lib2Type, 'function');
    });
});
@hallas
Copy link

hallas commented Jun 20, 2014

I have to be quite clear. Assert works.

You have a bunch of circular dependencies by the looks of it.

@hallas hallas closed this as completed Jun 20, 2014
@dino-su
Copy link
Author

dino-su commented Jun 21, 2014

Yes, I just figured that out, thanks!

https://gist.github.com/dno/5a5190f888fa385ef61e/revisions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants