initial-commit
This commit is contained in:
42
test/plugin.test.js
Normal file
42
test/plugin.test.js
Normal file
@@ -0,0 +1,42 @@
|
||||
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,
|
||||
)
|
||||
Reference in New Issue
Block a user