mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-22 08:38:29 +02:00
Update plugins
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
import { Context } from '@yaakapp/api';
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { pluginHookImport } from '../src';
|
||||
|
||||
const ctx = {} as Context;
|
||||
import { migrateImport } from '../src';
|
||||
|
||||
describe('importer-yaak', () => {
|
||||
test('Skips invalid imports', () => {
|
||||
expect(pluginHookImport(ctx, 'not JSON')).toBeUndefined();
|
||||
expect(pluginHookImport(ctx, '[]')).toBeUndefined();
|
||||
expect(pluginHookImport(ctx, JSON.stringify({ resources: {} }))).toBeUndefined();
|
||||
expect(migrateImport('not JSON')).toBeUndefined();
|
||||
expect(migrateImport('[]')).toBeUndefined();
|
||||
expect(migrateImport(JSON.stringify({ resources: {} }))).toBeUndefined();
|
||||
});
|
||||
|
||||
test('converts schema 1 to 2', () => {
|
||||
const imported = pluginHookImport(
|
||||
ctx,
|
||||
const imported = migrateImport(
|
||||
JSON.stringify({
|
||||
yaakSchema: 1,
|
||||
resources: {
|
||||
@@ -31,8 +27,7 @@ describe('importer-yaak', () => {
|
||||
);
|
||||
});
|
||||
test('converts schema 2 to 3', () => {
|
||||
const imported = pluginHookImport(
|
||||
ctx,
|
||||
const imported = migrateImport(
|
||||
JSON.stringify({
|
||||
yaakSchema: 2,
|
||||
resources: {
|
||||
|
||||
Reference in New Issue
Block a user