Skip to content

Inconsistent type. #1245

Closed
Closed

Description

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');
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions