Skip to content

Commit e47b73f

Browse files
committed
feat: move parser-options to vitest
1 parent 62321db commit e47b73f

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"rollup-plugin-sourcemaps": "^0.6.3",
6060
"ts-node": "^10.9.2",
6161
"typescript": "~5.7.3",
62+
"vitest": "^3.2.4",
6263
"wait-on": "^6.0.0",
6364
"warun": "^1.0.0"
6465
},

test/parser-options.js renamed to test/parser-options.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
* @author Toru Nagashima <https://github.com/mysticatea>
33
* See LICENSE file in root directory for full license.
44
*/
5-
"use strict"
65

7-
const assert = require("assert")
8-
const { parseForESLint } = require("../src")
9-
const eslint = require("eslint")
10-
const Linter = eslint.Linter
6+
import { describe, it, assert } from "vitest"
7+
import { parseForESLint } from "../src"
8+
import { Linter } from "eslint"
119

1210
describe("parserOptions", () => {
1311
describe("parser", () => {
@@ -33,7 +31,7 @@ describe("parserOptions", () => {
3331
it("false then skip parsing '<script>'.", () => {
3432
const code = `<template>Hello</template>
3533
<script>This is syntax error</script>`
36-
const config = {
34+
const config: Linter.Config = {
3735
files: ["*.vue"],
3836
plugins: {
3937
vue: plugin,
@@ -57,7 +55,7 @@ describe("parserOptions", () => {
5755
it("Fail in <script setup> with sourceType: script.", () => {
5856
const code = `<template>Hello</template>
5957
<script setup>import Foo from './foo'</script>`
60-
const config = {
58+
const config: Linter.Config = {
6159
files: ["*.vue"],
6260
plugins: {
6361
vue: plugin,

vitest.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig} from 'vitest/config'
2+
3+
export default defineConfig({
4+
test: {
5+
include: ['test/parser-options.test.ts']
6+
}
7+
})

0 commit comments

Comments
 (0)