43 lines
893 B
JavaScript
43 lines
893 B
JavaScript
import { describe, it } from 'vitest'
|
|
import { runPluginTests } from '@takerofnotes/plugin-sdk'
|
|
import plugin from './src/index.js'
|
|
import SupabaseAdapter from '../src/SupabaseAdapter.js'
|
|
|
|
const adapter = new SupabaseAdapter({
|
|
supabaseUrl: import.meta.env.VITE_SUPABASE_URL,
|
|
supabaseKey: import.meta.env.VITE_SUPABASE_KEY,
|
|
})
|
|
const tests = runPluginTests({ plugin, adapter })
|
|
|
|
describe('Plugin Validation', () => {
|
|
tests.validatePlugin(it, (a, b) => expect(a).toBe(b))
|
|
})
|
|
|
|
describe('Adapter: init()', () => {
|
|
tests.init(it)
|
|
})
|
|
|
|
describe('Adapter: getAll()', () => {
|
|
tests.getAll(it)
|
|
})
|
|
|
|
describe('Adapter: create()', () => {
|
|
tests.create(it)
|
|
})
|
|
|
|
describe('Adapter: update()', () => {
|
|
tests.update(it)
|
|
})
|
|
|
|
describe('Adapter: delete()', () => {
|
|
tests.delete(it)
|
|
})
|
|
|
|
describe(
|
|
'Full CRUD Cycle',
|
|
() => {
|
|
tests.crudCycle(it)
|
|
},
|
|
10 * 1000,
|
|
)
|