1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
import i18next from '../src/i18next.js';
describe('i18next', () => {
describe('promise based api', () => {
describe('init()', () => {
it('it should return a promise', done => {
i18next.init().then(t => {
expect(typeof t).to.equal('function');
done();
});
});
});
describe('changeLanguage()', () => {
it('it should return a promise', done => {
i18next.init();
i18next.changeLanguage().then(t => {
expect(typeof t).to.equal('function');
done();
});
});
});
describe('loadLanguages()', () => {
it('it should return a promise', done => {
i18next.init();
i18next.loadLanguages('en').then(() => {
done();
});
});
});
describe('loadNamespaces()', () => {
it('it should return a promise', done => {
i18next.init();
i18next.loadNamespaces('common').then(() => {
done();
});
});
});
describe('reloadResources()', () => {
it('it should return a promise', done => {
i18next.init();
i18next.reloadResources().then(() => {
done();
});
});
});
});
});
|