Skip to content

Commit 7dcaa23

Browse files
committed
test: add tests
1 parent 104f8b2 commit 7dcaa23

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- message: Do not pass async functions to svelte stores.
2+
line: 3
3+
column: 28
4+
suggestions: null
5+
- message: Do not pass async functions to svelte stores.
6+
line: 6
7+
column: 28
8+
suggestions: null
9+
- message: Do not pass async functions to svelte stores.
10+
line: 9
11+
column: 24
12+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { writable, readable, derived } from "svelte/store"
2+
3+
const w2 = writable(false, async () => {
4+
/** do nothing */
5+
})
6+
const r2 = readable(false, async () => {
7+
/** do nothing */
8+
})
9+
const d2 = derived(a1, async ($a1) => {
10+
/** do nothing */
11+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { writable, readable, derived } from "svelte/store"
2+
3+
const w1 = writable(false, () => {
4+
/** do nothing */
5+
})
6+
const r1 = readable(false, () => {
7+
/** do nothing */
8+
})
9+
const d1 = derived(a1, ($a1) => {
10+
/** do nothing */
11+
})

tests/src/rules/no-store-async.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleTester } from "eslint"
2+
import rule from "../../../src/rules/no-store-async"
3+
import { loadTestCases } from "../../utils/utils"
4+
5+
const tester = new RuleTester({
6+
parserOptions: {
7+
ecmaVersion: 2020,
8+
sourceType: "module",
9+
},
10+
})
11+
12+
tester.run("no-store-async", rule as any, loadTestCases("no-store-async"))

0 commit comments

Comments
 (0)