Skip to content

Commit 26e6306

Browse files
committed
fix: only log sass warning once
1 parent 8f72df8 commit 26e6306

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/logger.js

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ module.exports.info = function info (msg) {
55
module.exports.warn = function info (msg) {
66
console.warn('\n[vue-jest]: ' + (msg) + '\n')
77
}
8+
9+
module.exports.shouldLogStyleWarn = true

lib/process.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ module.exports = function (src, filePath) {
101101
}
102102

103103
if (Array.isArray(parts.styles) && parts.styles.length > 0) {
104-
if (parts.styles.some(ast => /^scss|sass|less|pcss|postcss/.test(ast.lang))) {
104+
if ((parts.styles.some(ast => /^scss|sass|less|pcss|postcss/.test(ast.lang))) && logger.shouldLogStyleWarn) {
105105
logger.warn('Sass/SCSS, Less and PostCSS are not currently compiled by vue-jest')
106+
logger.shouldLogStyleWarn = false
106107
}
107108

108109
const styleStr = parts.styles.map(ast => {

0 commit comments

Comments
 (0)