global-modulize
Version:
Make it easy to import any file by using config file.
50 lines (36 loc) • 1.15 kB
JavaScript
import gm from '../../dist/index';
const assert = require('chai').assert;
const expect = require('chai').expect;
describe('common', () => {
let libcommon = null;
before(() => {
libcommon = gm('lib.common');
});
it('should be a function', () => {
assert.isFunction(libcommon);
});
it('should be callable', () => {
expect(libcommon('abcd')).to.be.equal('dcba');
});
it('should have bool property', () => {
expect(libcommon.bool).to.be.equal(true);
});
it('should have number property', () => {
expect(libcommon.number).to.be.equal(1991);
});
it('should have string property', () => {
expect(libcommon.string).to.be.equal('string');
});
it('should have function property', () => {
assert.isFunction(libcommon.upperCase);
});
it('funtion property should be callable', () => {
expect(libcommon.upperCase('string')).to.equal('STRING');
});
it('should have array property', () => {
expect(libcommon.array).to.deep.equal([1, 2, 3, 4, 5]);
});
it('should have object property', () => {
expect(libcommon.object).to.deep.equal({ language: 'JavaScript' });
});
});