+24
-7
lines changedFilter options
+24
-7
lines changed Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import * as directives from './directives';
3
3
import * as services from './services';
4
4
import locale from './locale';
5
5
6
-
const install = (app, options = {}) => {
6
+
export const install = (app, options = {}) => {
7
7
// Setup language, en-US for default
8
8
locale.use(options.locale);
9
9
locale.i18n(options.i18n);
@@ -28,5 +28,3 @@ const install = (app, options = {}) => {
28
28
});
29
29
});
30
30
};
31
-
32
-
export { install };
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ describe('install', () => {
11
11
dSpy = jest.spyOn(app, 'directive');
12
12
});
13
13
14
+
it('should have install function', async () => {
15
+
expect(uiv.install).toEqual(expect.any(Function));
16
+
});
17
+
14
18
it('should be able to install with prefix', () => {
15
19
// simulate a Vue.use
16
20
app.use(uiv, { prefix: 'uiv' });
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1
1
export function pad(value, num) {
2
-
value = value + '';
3
-
for (let i = num - value.length; i > 0; i--) {
4
-
value = '0' + value;
2
+
let res = value.toString();
3
+
for (let i = num - res.length; i > 0; i--) {
4
+
res = '0' + res;
5
5
}
6
-
return value;
6
+
return res;
7
7
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1
+
import * as utils from './string.utils';
2
+
3
+
describe('string.utils', () => {
4
+
describe('#pad ', () => {
5
+
it('should be able to pad string', () => {
6
+
expect(utils.pad('1', 2)).toEqual('01');
7
+
expect(utils.pad('01', 2)).toEqual('01');
8
+
expect(utils.pad('001', 2)).toEqual('001');
9
+
});
10
+
11
+
it('should be able to pad non string', () => {
12
+
expect(utils.pad(100, 5)).toEqual('00100');
13
+
});
14
+
});
15
+
});
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4