Skip to content

Commit b63a424

Browse files
committed
feat(coffeescript): add support for lang=coffeescript
1 parent 8bbe850 commit b63a424

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jest-vue compiles the script and template of SFCs into a JavaScript file that Je
3434
### Supported script languages
3535

3636
- **typescript** (`lang="ts"`, `lang="typescript"`)
37-
- **coffeescript** (`lang="coffee"`)
37+
- **coffeescript** (`lang="coffee"`, `lang="coffeescript"`)
3838

3939
### Supported template languages
4040

jest-vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function processScript (scriptPart) {
1414
return compileTypescript(scriptPart.content)
1515
}
1616

17-
if (scriptPart.lang === 'coffee') {
17+
if (scriptPart.lang === 'coffee' || scriptPart.lang === 'coffeescript') {
1818
return compileCoffeeScript(scriptPart.content)
1919
}
2020

test/coffee.spec.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { shallow } from 'vue-test-utils'
22
import Coffee from './resources/Coffee.vue'
3+
import CoffeeScript from './resources/CoffeeScript.vue'
34

4-
test('processes .vue file with coffee script', () => {
5+
test('processes .vue file with lang set to coffeescript', () => {
56
shallow(Coffee)
67
})
8+
9+
test('processes .vue file with lang set to coffeescript', () => {
10+
shallow(CoffeeScript)
11+
})

test/resources/CoffeeScript.vue

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<template>
2+
<div />
3+
</template>
4+
5+
<script lang="coffeescript">
6+
module.exports =
7+
data: -> {}
8+
</script>

0 commit comments

Comments
 (0)