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