Skip to content

Commit 5791e04

Browse files
committed
Version 1.3.3.
Test coverage back to 100%.
1 parent 6abc1b5 commit 5791e04

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vuejs-logger",
33
"author": "Justin Kames",
4-
"version": "1.3.2",
4+
"version": "1.3.3",
55
"description": "Vuejs-logger, provides customizable logging functionality for Vue.js.",
66
"main": "dist/index.js",
77
"repository": {

Diff for: src/logger.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default (function () {
33
const defaultOptions = {
44
logLevel: 'debug',
55
separator: '|',
6-
stringifyByDefault: false,
6+
stringifyArguments: false,
77
showLogLevel: false,
88
showMethodName: false,
99
showConsoleColors: false,
@@ -53,7 +53,7 @@ export default (function () {
5353
if (options.showConsoleColors && typeof options.showConsoleColors !== 'boolean') {
5454
return false
5555
}
56-
if (options.separator && (typeof options.separator === 'string' && options.separator.length > 3)) {
56+
if (options.separator && (typeof options.separator !== 'string' || (typeof options.separator === 'string' && options.separator.length > 3))) {
5757
return false
5858
}
5959
return !(options.showMethodName && typeof options.showMethodName !== 'boolean')

Diff for: test/logger.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,14 @@ describe('Logger.js', () => {
151151

152152
it('isValidOptions() should fail with incorrect options.', () => {
153153

154-
it('isValidOptions() should pass with correct options.', () => {
155-
expect(isValidOptions({
156-
logLevel: 'debug',
157-
stringifyByDefault: false,
158-
showLogLevel: false,
159-
showMethodName: true,
160-
separator: '|||||',
161-
showConsoleColors: false,
162-
}, logLevels)).to.equal(true)
163-
})
154+
expect(isValidOptions({
155+
logLevel: 'debug',
156+
stringifyByDefault: false,
157+
showLogLevel: false,
158+
showMethodName: true,
159+
separator: '|||||',
160+
showConsoleColors: false,
161+
}, logLevels)).to.equal(false)
164162

165163
expect(isValidOptions({
166164
logLevel: 'debug',
@@ -210,6 +208,12 @@ describe('Logger.js', () => {
210208
expect(isValidOptions({
211209
logLevel: 'debug',
212210
}, logLevels)).to.equal(true)
211+
212+
expect(isValidOptions({
213+
logLevel: 'debug',
214+
separator: '1234',
215+
}, logLevels)).to.equal(false)
216+
213217
})
214218
})
215219

0 commit comments

Comments
 (0)