Skip to content

Commit 948cf45

Browse files
committed
Fixes UT gotcha.
Signed-off-by: Eric Wang <[email protected]>
1 parent ff1f3b4 commit 948cf45

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/chalk.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ chalk.init = function() {
5858
Object.defineProperty(chalk, color, {
5959
get: function() {
6060
return chalk.wrap(chalk.theme[color], style.color.close);
61-
}
61+
},
62+
configurable: true
6263
});
6364
});
6465

@@ -67,7 +68,8 @@ chalk.init = function() {
6768
Object.defineProperty(chalk, modifier, {
6869
get: function() {
6970
return chalk.wrap(style[modifier].open, style[modifier].close);
70-
}
71+
},
72+
configurable: true
7173
});
7274
});
7375
};

test/plugins/test_leetcode.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('plugin:leetcode', function() {
3535
session.getUser = function() {
3636
return USER;
3737
};
38+
session.saveUser = function() {};
3839
plugin.__set__('session', session);
3940
});
4041

test/test_log.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe('log', function() {
88
var result = '';
99

1010
before(function() {
11+
chalk.init();
1112
_output = log.output;
1213
log.output = function(s) {
1314
result = s;

0 commit comments

Comments
 (0)