Skip to content

Commit bb458b3

Browse files
committed
test for script setup extruction added
1 parent 4ab0e06 commit bb458b3

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template>
2+
<div>Hello world</div>
3+
</template>
4+
5+
<script setup>
6+
/**
7+
* @vue-event {String} foo - Emit foo event
8+
*/
9+
const emit = defineEmits(['foo'])
10+
</script>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`core.extractVueScript extract script 1`] = `
4+
"
5+
/**
6+
* @vue-event {String} foo - Emit foo event
7+
*/
8+
const emit = defineEmits(['foo'])
9+
"
10+
`;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require('path');
2+
const extractVueScript = require('../../lib/core/vueScriptExtractor');
3+
4+
describe('core.extractVueScript', () => {
5+
const filename = path.join(__dirname, '__fixtures__', 'ComponentScriptSetup.vue');
6+
7+
test('extract script', () => {
8+
expect(extractVueScript(filename)).toMatchSnapshot();
9+
});
10+
});

0 commit comments

Comments
 (0)