mirror of
https://github.com/gavvvr/obsidian-timecodes-plugin.git
synced 2026-07-22 12:00:24 +00:00
test: fix "Failed to parse ... TimecodesPlugin.ts" error
Fix "Failed to parse ... TimecodesPlugin.ts" error by creating virtual module for 'obsidian' package. Related discussion: vitest-dev/vitest#9298
This commit is contained in:
parent
3980070aae
commit
a2fb2d7c4f
1 changed files with 18 additions and 0 deletions
|
|
@ -1,6 +1,24 @@
|
|||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
{
|
||||
name: 'virtual-obsidian',
|
||||
enforce: 'pre',
|
||||
resolveId(id) {
|
||||
if (id === 'obsidian') {
|
||||
return '\0obsidian'
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === '\0obsidian') {
|
||||
return `
|
||||
export class Plugin {}
|
||||
export default {}`
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
test: {
|
||||
isolate: false,
|
||||
pool: 'threads',
|
||||
|
|
|
|||
Loading…
Reference in a new issue