diff --git a/e2e/2.x/style/components/Less.vue b/e2e/2.x/style/components/Less.vue index 2731b5dc..3e94f459 100644 --- a/e2e/2.x/style/components/Less.vue +++ b/e2e/2.x/style/components/Less.vue @@ -1,9 +1,18 @@ diff --git a/e2e/2.x/style/components/styles/less-a.less b/e2e/2.x/style/components/styles/less-a.less new file mode 100644 index 00000000..6b45a74c --- /dev/null +++ b/e2e/2.x/style/components/styles/less-a.less @@ -0,0 +1,7 @@ +@import "variables"; +.c { + color: @primary-color; +} +.d { + background-color: @primary-color; +} diff --git a/packages/vue2-jest/lib/process-style.js b/packages/vue2-jest/lib/process-style.js index 95f32446..538705ba 100644 --- a/packages/vue2-jest/lib/process-style.js +++ b/packages/vue2-jest/lib/process-style.js @@ -45,7 +45,7 @@ function getPreprocessOptions(lang, filePath, jestConfig) { }) } } - if (lang === 'styl' || lang === 'stylus') { + if (lang === 'styl' || lang === 'stylus' || lang === 'less') { return { paths: [path.dirname(filePath), process.cwd()] }